projects
/
debian
/
amanda
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'upstream/3.3.3'
[debian/amanda]
/
common-src
/
match.c
diff --git
a/common-src/match.c
b/common-src/match.c
index cd363e45877ca5e399040ad7d7744284de8fa7cb..328097c4334a9e1604fa02aa3b183f45a1c114f5 100644
(file)
--- a/
common-src/match.c
+++ b/
common-src/match.c
@@
-1,6
+1,7
@@
/*
* Amanda, The Advanced Maryland Automatic Network Disk Archiver
* Copyright (c) 1991-1998 University of Maryland at College Park
/*
* Amanda, The Advanced Maryland Automatic Network Disk Archiver
* Copyright (c) 1991-1998 University of Maryland at College Park
+ * Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved.
* All Rights Reserved.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* All Rights Reserved.
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@
-869,6
+870,9
@@
int match_host(const char *glob, const char *host)
char *lglob, *lhost;
int ret;
char *lglob, *lhost;
int ret;
+ if (*glob == '=') {
+ return strcmp(glob+1, host) == 0;
+ }
lglob = g_ascii_strdown(glob, -1);
lhost = g_ascii_strdown(host, -1);
lglob = g_ascii_strdown(glob, -1);
lhost = g_ascii_strdown(host, -1);
@@
-937,6
+941,10
@@
int match_disk(const char *glob, const char *disk)
gboolean windows_share = !(strncmp(disk, "\\\\", 2) || strchr(disk, '/'));
gboolean windows_share = !(strncmp(disk, "\\\\", 2) || strchr(disk, '/'));
+ if (*glob == '=') {
+ return strcmp(glob+1, disk) == 0;
+ }
+
if (windows_share) {
glob2 = convert_winglob_to_unix(glob);
disk2 = convert_unc_to_unix(disk);
if (windows_share) {
glob2 = convert_winglob_to_unix(glob);
disk2 = convert_unc_to_unix(disk);
@@
-986,6
+994,10
@@
match_datestamp(
goto illegal;
}
goto illegal;
}
+ if (*dateexp == '=') {
+ return strcmp(dateexp+1, datestamp) == 0;
+ }
+
/* strip and ignore an initial "^" */
if(dateexp[0] == '^') {
strncpy(mydateexp, dateexp+1, sizeof(mydateexp)-1);
/* strip and ignore an initial "^" */
if(dateexp[0] == '^') {
strncpy(mydateexp, dateexp+1, sizeof(mydateexp)-1);
@@
-1068,6
+1080,10
@@
match_level(
/*NOTREACHED*/
}
/*NOTREACHED*/
}
+ if (*levelexp == '=') {
+ return strcmp(levelexp+1, level) == 0;
+ }
+
if(levelexp[0] == '^') {
strncpy(mylevelexp, levelexp+1, strlen(levelexp)-1);
mylevelexp[strlen(levelexp)-1] = '\0';
if(levelexp[0] == '^') {
strncpy(mylevelexp, levelexp+1, strlen(levelexp)-1);
mylevelexp[strlen(levelexp)-1] = '\0';