Просмотр исходного кода

Wrong offset for clish_pargv_new was fixed. The line don't contain the prompt.

git-svn-id: https://klish.googlecode.com/svn/trunk@172 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 14 лет назад
Родитель
Сommit
58f97e384e
1 измененных файлов с 5 добавлено и 15 удалено
  1. 5 15
      clish/shell/shell_parse.c

+ 5 - 15
clish/shell/shell_parse.c

@@ -11,23 +11,13 @@ clish_shell_parse(const clish_shell_t * this,
 		  const char *line,
 		  const clish_command_t ** cmd, clish_pargv_t ** pargv)
 {
-	clish_pargv_status_t result = CLISH_BAD_CMD;
-	size_t offset;
-	char *prompt = clish_view__get_prompt(this->view, this->viewid);
-
-	/* track the offset of each parameter on the command line */
-	offset = strlen(prompt) + 1;
-
-	/* cleanup */
-	lub_string_free(prompt);
+ 	clish_pargv_status_t result = CLISH_BAD_CMD;
 
 	*cmd = clish_shell_resolve_command(this, line);
-	if (NULL != *cmd) {
-		/*
-		 * Now construct the parameters for the command
-		 */
-		*pargv = clish_pargv_new(*cmd, line, offset, &result);
-	}
+	/* Now construct the parameters for the command */
+	if (NULL != *cmd)
+		*pargv = clish_pargv_new(*cmd, line, 0, &result);
+
 	return result;
 }