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

Submitted by:	Robert Elz
MFC after:	3 days
This commit is contained in:
jilles 2018-04-29 17:46:08 +00:00
parent 65d851d412
commit 78d6d49b25
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 == ':') {
found |= match_charclass(p, chr, &end);
if (end != NULL)
if (end != NULL) {
p = end;
continue;
}
}
if (c == CTLESC)
c = *p++;

View File

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

View File

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