[asterisk-commits] russell: branch russell/test-api-1.4 r272807 - /team/russell/test-api-1.4/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 28 12:45:14 CDT 2010


Author: russell
Date: Mon Jun 28 12:45:10 2010
New Revision: 272807

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=272807
Log:
fix tab completion bug

Modified:
    team/russell/test-api-1.4/main/test.c

Modified: team/russell/test-api-1.4/main/test.c
URL: http://svnview.digium.com/svn/asterisk/team/russell/test-api-1.4/main/test.c?view=diff&rev=272807&r1=272806&r2=272807
==============================================================================
--- team/russell/test-api-1.4/main/test.c (original)
+++ team/russell/test-api-1.4/main/test.c Mon Jun 28 12:45:10 2010
@@ -28,8 +28,6 @@
 #include "asterisk.h"
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$");
-
-#include "asterisk/_private.h"
 
 #ifdef TEST_FRAMEWORK
 #include "asterisk/test.h"
@@ -592,11 +590,12 @@
 	int wordlen = strlen(word);
 	char *ret = NULL;
 	struct ast_test *test;
-	char *cat = ast_strdupa(line);
+	char *cat = NULL;
+	char *tmp = ast_strdupa(line);
 	int i;
 
-	for (i = 0; i < cat_pos && cat; strsep(&cat, " ")) {
-		cat = ast_skip_blanks(cat);
+	for (i = 0; i < cat_pos - 1 && tmp; cat = strsep(&tmp, " "), cat_pos--) {
+		tmp = ast_skip_blanks(tmp);
 	}
 
 	AST_LIST_LOCK(&tests);




More information about the asterisk-commits mailing list