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:
Kevin P. Fleming
2005-06-06 22:39:32 +00:00
parent 2b8338cb52
commit c0b1e88e8a
82 changed files with 743 additions and 366 deletions

View File

@@ -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(&regexbuf, iterator->file, 0, NULL, 0))
continue;
ast_cli(fd, FORMAT, iterator->file, iterator->version);
if (havename)
break;
}
AST_LIST_UNLOCK(&file_versions);