diff options
author | kientzle <kientzle@FreeBSD.org> | 2010-10-06 04:30:40 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2010-10-06 04:30:40 +0000 |
commit | 6af162923c22a913499ec87645671c5e83da59d0 (patch) | |
tree | eced584d931be7f1967209c55a114ff435c5a973 /usr.bin | |
parent | fd7760cc1cbc436fe3b0807c60808edfbea73411 (diff) | |
download | FreeBSD-src-6af162923c22a913499ec87645671c5e83da59d0.zip FreeBSD-src-6af162923c22a913499ec87645671c5e83da59d0.tar.gz |
Recognize both ! and ^ as markers for negated character classes.
Submitted by: Mykola Dzham
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tar/pathmatch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tar/pathmatch.c b/usr.bin/tar/pathmatch.c index 8b43138..a994d44 100644 --- a/usr.bin/tar/pathmatch.c +++ b/usr.bin/tar/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; |