mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 12:52:33 +00:00
the last round of file version tags
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
10
asterisk.c
10
asterisk.c
@@ -210,6 +210,7 @@ static int handle_show_version_files(int fd, int argc, char *argv[])
|
||||
struct file_version *iterator;
|
||||
regex_t regexbuf;
|
||||
int havepattern = 0;
|
||||
int havename = 0;
|
||||
|
||||
switch (argc) {
|
||||
case 5:
|
||||
@@ -220,6 +221,9 @@ static int handle_show_version_files(int fd, int argc, char *argv[])
|
||||
} else
|
||||
return RESULT_SHOWUSAGE;
|
||||
break;
|
||||
case 4:
|
||||
havename = 1;
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
default:
|
||||
@@ -230,10 +234,16 @@ 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]))
|
||||
continue;
|
||||
|
||||
if (havepattern && regexec(®exbuf, iterator->file, 0, NULL, 0))
|
||||
continue;
|
||||
|
||||
ast_cli(fd, FORMAT, iterator->file, iterator->version);
|
||||
|
||||
if (havename)
|
||||
break;
|
||||
}
|
||||
AST_LIST_UNLOCK(&file_versions);
|
||||
|
||||
|
Reference in New Issue
Block a user