diff options
author | Tim Kientzle <kientzle@gmail.com> | 2010-10-06 00:19:58 -0400 |
---|---|---|
committer | Tim Kientzle <kientzle@gmail.com> | 2010-10-06 00:19:58 -0400 |
commit | b0f618f94d6ec062a2a1a0c1e282d662a82f5832 (patch) | |
tree | b734d8bb9e13c7da6259e60721655f1ef415f8a6 /libarchive_fe | |
parent | 8a6413662453be6c57926c21debe7b1667309db1 (diff) | |
download | libarchive-b0f618f94d6ec062a2a1a0c1e282d662a82f5832.tar.gz |
Accept both '!' and '^' for a negated character class.
SVN-Revision: 2748
Diffstat (limited to 'libarchive_fe')
-rw-r--r-- | libarchive_fe/pathmatch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libarchive_fe/pathmatch.c b/libarchive_fe/pathmatch.c index 85074bdb..e2113620 100644 --- a/libarchive_fe/pathmatch.c +++ b/libarchive_fe/pathmatch.c @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); /* * Check whether a character 'c' is matched by a list specification [...]: - * * Leading '!' negates the class. + * * Leading '!' or '^' negates the class. * * <char>-<char> is a range of characters * * \<char> removes any special meaning for <char> * @@ -60,7 +60,7 @@ pm_list(const char *start, const char *end, const char c, int flags) (void)flags; /* UNUSED */ /* If this is a negated class, return success for nomatch. */ - if (*p == '!' && p < end) { + if ((*p == '!' || *p == '^') && p < end) { match = 0; nomatch = 1; ++p; |