sh: Don't have [ match any [[:class:]]

Submitted by:	Robert Elz
MFC after:	3 days
This commit is contained in:
Jilles Tjoelker 2018-04-29 17:46:08 +00:00
parent a7163bb962
commit 4d7f36eea5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333092
3 changed files with 9 additions and 1 deletions

View File

@ -1342,8 +1342,10 @@ patmatch(const char *pattern, const char *string)
} }
if (c == '[' && *p == ':') { if (c == '[' && *p == ':') {
found |= match_charclass(p, chr, &end); found |= match_charclass(p, chr, &end);
if (end != NULL) if (end != NULL) {
p = end; p = end;
continue;
}
} }
if (c == CTLESC) if (c == CTLESC)
c = *p++; c = *p++;

View File

@ -42,6 +42,7 @@ ${PACKAGE}FILES+= case19.0
${PACKAGE}FILES+= case20.0 ${PACKAGE}FILES+= case20.0
${PACKAGE}FILES+= case21.0 ${PACKAGE}FILES+= case21.0
${PACKAGE}FILES+= case22.0 ${PACKAGE}FILES+= case22.0
${PACKAGE}FILES+= case23.0
${PACKAGE}FILES+= cd1.0 ${PACKAGE}FILES+= cd1.0
${PACKAGE}FILES+= cd2.0 ${PACKAGE}FILES+= cd2.0
${PACKAGE}FILES+= cd3.0 ${PACKAGE}FILES+= cd3.0

View File

@ -0,0 +1,5 @@
# $FreeBSD$
case [ in
[[:alpha:]]) echo bad
esac