normalize cli completion code
authorLuigi Rizzo <rizzo@icir.org>
Fri, 14 Apr 2006 22:17:27 +0000 (22:17 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Fri, 14 Apr 2006 22:17:27 +0000 (22:17 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20166 65c4cc65-6c06-0410-ace0-fbb531ad65f3

asterisk.c

index 642f1b5..ad9cfb8 100644 (file)
@@ -548,11 +548,9 @@ static char *complete_show_version_files(const char *line, const char *word, int
 
        AST_LIST_LOCK(&file_versions);
        AST_LIST_TRAVERSE(&file_versions, find, list) {
-               if (!strncasecmp(word, find->file, matchlen)) {
-                       if (++which > state) {
-                               ret = strdup(find->file);
-                               break;
-                       }
+               if (!strncasecmp(word, find->file, matchlen) && ++which > state) {
+                       ret = ast_strdup(find->file);
+                       break;
                }
        }
        AST_LIST_UNLOCK(&file_versions);