svn commit: r333092 - in head/bin/sh: . tests/builtins

Jilles Tjoelker jilles at FreeBSD.org
Sun Apr 29 17:46:09 UTC 2018


Author: jilles
Date: Sun Apr 29 17:46:08 2018
New Revision: 333092
URL: https://svnweb.freebsd.org/changeset/base/333092

Log:
  sh: Don't have [ match any [[:class:]]
  
  Submitted by:	Robert Elz
  MFC after:	3 days

Added:
  head/bin/sh/tests/builtins/case23.0   (contents, props changed)
Modified:
  head/bin/sh/expand.c
  head/bin/sh/tests/builtins/Makefile

Modified: head/bin/sh/expand.c
==============================================================================
--- head/bin/sh/expand.c	Sun Apr 29 12:43:08 2018	(r333091)
+++ head/bin/sh/expand.c	Sun Apr 29 17:46:08 2018	(r333092)
@@ -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++;

Modified: head/bin/sh/tests/builtins/Makefile
==============================================================================
--- head/bin/sh/tests/builtins/Makefile	Sun Apr 29 12:43:08 2018	(r333091)
+++ head/bin/sh/tests/builtins/Makefile	Sun Apr 29 17:46:08 2018	(r333092)
@@ -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

Added: head/bin/sh/tests/builtins/case23.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/bin/sh/tests/builtins/case23.0	Sun Apr 29 17:46:08 2018	(r333092)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+case [ in
+[[:alpha:]]) echo bad
+esac


More information about the svn-src-all mailing list