mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Merged revisions 56783 via svnmerge from
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
This commit is contained in:
@@ -564,18 +564,18 @@ static int handle_show_version_files(int fd, int argc, char *argv[])
|
|||||||
int count_files = 0;
|
int count_files = 0;
|
||||||
|
|
||||||
switch (argc) {
|
switch (argc) {
|
||||||
case 5:
|
case 6:
|
||||||
if (!strcasecmp(argv[3], "like")) {
|
if (!strcasecmp(argv[4], "like")) {
|
||||||
if (regcomp(®exbuf, argv[4], REG_EXTENDED | REG_NOSUB))
|
if (regcomp(®exbuf, argv[5], REG_EXTENDED | REG_NOSUB))
|
||||||
return RESULT_SHOWUSAGE;
|
return RESULT_SHOWUSAGE;
|
||||||
havepattern = 1;
|
havepattern = 1;
|
||||||
} else
|
} else
|
||||||
return RESULT_SHOWUSAGE;
|
return RESULT_SHOWUSAGE;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 5:
|
||||||
havename = 1;
|
havename = 1;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 4:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return RESULT_SHOWUSAGE;
|
return RESULT_SHOWUSAGE;
|
||||||
@@ -585,7 +585,7 @@ static int handle_show_version_files(int fd, int argc, char *argv[])
|
|||||||
ast_cli(fd, FORMAT, "----", "--------");
|
ast_cli(fd, FORMAT, "----", "--------");
|
||||||
AST_LIST_LOCK(&file_versions);
|
AST_LIST_LOCK(&file_versions);
|
||||||
AST_LIST_TRAVERSE(&file_versions, iterator, list) {
|
AST_LIST_TRAVERSE(&file_versions, iterator, list) {
|
||||||
if (havename && strcasecmp(iterator->file, argv[3]))
|
if (havename && strcasecmp(iterator->file, argv[4]))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (havepattern && regexec(®exbuf, iterator->file, 0, NULL, 0))
|
if (havepattern && regexec(®exbuf, iterator->file, 0, NULL, 0))
|
||||||
|
Reference in New Issue
Block a user