diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-17 22:44:53 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-17 22:44:53 +0000 |
commit | 86e437c3c370500dd9600a8bdfff78b82290e4c6 (patch) | |
tree | d03570e450231044a89bb1cff8c216231daee06a /main/test.c | |
parent | 57ef68cb88c0d1ad3245ace04e1874bb0824aeb0 (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: http://svn.digium.com/svn/asterisk/trunk@247381 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/test.c')
-rw-r--r-- | main/test.c | 4 |
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; } |