Browse Source

Fix completion with prefix

git-svn-id: https://klish.googlecode.com/svn/trunk@508 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 12 years ago
parent
commit
486a61298e
1 changed files with 6 additions and 2 deletions
  1. 6 2
      clish/nspace/nspace.c

+ 6 - 2
clish/nspace/nspace.c

@@ -12,6 +12,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <regex.h>
+#include <ctype.h>
 
 /*---------------------------------------------------------
  * PRIVATE METHODS
@@ -225,8 +226,11 @@ const clish_command_t *clish_nspace_find_next_completion(clish_nspace_t * this,
 
 	if (in_line[0] != '\0') {
 		/* If prefix is followed by space */
-		if (in_line[0] == ' ')
-			in_line++;
+		if (!isspace(in_line[0])) {
+			lub_string_free(real_prefix);
+			return NULL;
+		}
+		in_line++;
 		if (iter_cmd &&
 			(lub_string_nocasestr(iter_cmd, real_prefix) == iter_cmd) &&
 			(lub_string_nocasecmp(iter_cmd, real_prefix)))