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
This commit is contained in:
Martin Matuska 2011-12-21 15:22:05 +00:00
parent 457fe389bb
commit e9dd49674a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=228775

View File

@ -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;