dect
/
asterisk
Archived
13
0
Fork 0

Fix a couple of bugs in test tab completion.

1. Add missing unlock of lists.
2. Swap order of arguments to test_cat_cmp in complete_test_name.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@247381 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
mmichelson 2010-02-17 22:44:53 +00:00
parent 57ef68cb88
commit 86e437c3c3
1 changed files with 3 additions and 1 deletions

View File

@ -579,6 +579,7 @@ static char *complete_test_category(const char *line, const char *word, int pos,
break;
}
}
AST_LIST_UNLOCK(&tests);
return ret;
}
@ -591,11 +592,12 @@ static char *complete_test_name(const char *line, const char *word, int pos, int
AST_LIST_LOCK(&tests);
AST_LIST_TRAVERSE(&tests, test, entry) {
if (!test_cat_cmp(category, test->info.category) && (!strncasecmp(word, test->info.name, wordlen) && ++which > state)) {
if (!test_cat_cmp(test->info.category, category) && (!strncasecmp(word, test->info.name, wordlen) && ++which > state)) {
ret = ast_strdup(test->info.name);
break;
}
}
AST_LIST_UNLOCK(&tests);
return ret;
}