Merged revisions 56783 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Mon, 26 Feb 2007 16:38:10 +0000 (16:38 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 26 Feb 2007 16:38:10 +0000 (16:38 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r56783 | file | 2007-02-26 11:36:08 -0500 (Mon, 26 Feb 2007) | 2 lines

Allow both of the show version files and core show file versions CLI commands to work. (issue #9135 reported by mvanbaak)

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56784 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/asterisk.c

index d421154..14bfb81 100644 (file)
@@ -564,18 +564,18 @@ static int handle_show_version_files(int fd, int argc, char *argv[])
        int count_files = 0;
 
        switch (argc) {
-       case 5:
-               if (!strcasecmp(argv[3], "like")) {
-                       if (regcomp(&regexbuf, argv[4], REG_EXTENDED | REG_NOSUB))
+       case 6:
+               if (!strcasecmp(argv[4], "like")) {
+                       if (regcomp(&regexbuf, argv[5], REG_EXTENDED | REG_NOSUB))
                                return RESULT_SHOWUSAGE;
                        havepattern = 1;
                } else
                        return RESULT_SHOWUSAGE;
                break;
-       case 4:
+       case 5:
                havename = 1;
                break;
-       case 3:
+       case 4:
                break;
        default:
                return RESULT_SHOWUSAGE;
@@ -585,7 +585,7 @@ static int handle_show_version_files(int fd, int argc, char *argv[])
        ast_cli(fd, FORMAT, "----", "--------");
        AST_LIST_LOCK(&file_versions);
        AST_LIST_TRAVERSE(&file_versions, iterator, list) {
-               if (havename && strcasecmp(iterator->file, argv[3]))
+               if (havename && strcasecmp(iterator->file, argv[4]))
                        continue;
 
                if (havepattern && regexec(&regexbuf, iterator->file, 0, NULL, 0))