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
This commit is contained in:
parent
dd975726fc
commit
23d1c9186d
|
@ -579,6 +579,7 @@ static char *complete_test_category(const char *line, const char *word, int pos,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
AST_LIST_UNLOCK(&tests);
|
||||||
return ret;
|
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_LOCK(&tests);
|
||||||
AST_LIST_TRAVERSE(&tests, test, entry) {
|
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);
|
ret = ast_strdup(test->info.name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
AST_LIST_UNLOCK(&tests);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue