Ver código fonte

Fix segmentation

git-svn-id: https://klish.googlecode.com/svn/trunk@398 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 13 anos atrás
pai
commit
9854d3f887
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      clish/shell/shell_command_generator.c

+ 1 - 1
clish/shell/shell_command_generator.c

@@ -50,7 +50,7 @@ void clish_shell_param_generator(clish_shell_t *this, lub_argv_t *matches,
 	/* get the index of the current parameter */
 	unsigned index = lub_argv_wordcount(line) - idx;
 
-	if ((0 != index) || (line[offset - 1] == ' ')) {
+	if ((0 != index) || (offset && line[offset - 1] == ' ')) {
 		lub_argv_t *argv = lub_argv_new(line, 0);
 		clish_pargv_t *pargv = clish_pargv_create();
 		clish_pargv_t *completion_pargv = clish_pargv_create();