From e9dd49674a5ddafac6a46cd903ea2a75e4918f9b Mon Sep 17 00:00:00 2001 From: Martin Matuska Date: Wed, 21 Dec 2011 15:22:05 +0000 Subject: Merge FreeBSD changes from usr.bin/tar to contrib/libarchive/libarchive_fe: r213469: Recognize both ! and ^ as markers for negated character classes. MFC after: 2 weeks --- contrib/libarchive/libarchive_fe/pathmatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/libarchive') diff --git a/contrib/libarchive/libarchive_fe/pathmatch.c b/contrib/libarchive/libarchive_fe/pathmatch.c index 85074bdb30b2..e211362066ef 100644 --- a/contrib/libarchive/libarchive_fe/pathmatch.c +++ b/contrib/libarchive/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. * * - is a range of characters * * \ removes any special meaning for * @@ -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; -- cgit v1.2.3