소스 검색

Fix segmentation

git-svn-id: https://klish.googlecode.com/svn/trunk@398 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 14 년 전
부모
커밋
9854d3f887
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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();