summaryrefslogtreecommitdiff
path: root/main/test.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2010-02-17 22:44:53 +0000
committerMark Michelson <mmichelson@digium.com>2010-02-17 22:44:53 +0000
commit23d1c9186d8ce18a37c856a5242a4a525c500f97 (patch)
treed03570e450231044a89bb1cff8c216231daee06a /main/test.c
parentdd975726fc4e7254269d39ebe9a6ed96de852dff (diff)
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: https://origsvn.digium.com/svn/asterisk/trunk@247381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/test.c')
-rw-r--r--main/test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/test.c b/main/test.c
index 41e00a89f..082af2901 100644
--- a/main/test.c
+++ b/main/test.c
@@ -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;
}