浏览代码

Add space to params if the beginning of the string only

git-svn-id: https://klish.googlecode.com/svn/trunk@156 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 13 年之前
父节点
当前提交
28f895ecd6
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      clish/variable/variable_expand.c

+ 2 - 4
clish/variable/variable_expand.c

@@ -74,8 +74,7 @@ static char *find_context_var(const context_t * this, const char *name)
 
 	if (!lub_string_nocasecmp(name, "__cmd")) {
 		if (this->cmd)
-			result =
-			    lub_string_dup(clish_command__get_name(this->cmd));
+			result = lub_string_dup(clish_command__get_name(this->cmd));
 	} else if (!lub_string_nocasecmp(name, "__line")) {
 		if (this->cmd && this->pargv)
 			result = clish_variable__get_line(this->cmd, this->pargv);
@@ -287,7 +286,7 @@ char *clish_variable__get_params(const clish_command_t * cmd, clish_pargv_t * pa
 		if (CLISH_PARAM_SWITCH == clish_param__get_mode(param))
 			continue;
 		parg = clish_pargv__get_parg(pargv, i);
-		if (0 != i)
+		if (NULL != line)
 			lub_string_cat(&line, " ");
 		lub_string_cat(&line, clish_parg__get_value(parg));
 	}
@@ -295,7 +294,6 @@ char *clish_variable__get_params(const clish_command_t * cmd, clish_pargv_t * pa
 	return line;
 }
 
-
 /*--------------------------------------------------------- */
 char *clish_variable__get_line(const clish_command_t * cmd, clish_pargv_t * pargv)
 {