Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/bin/sh Pull up following revision(s) (requested by kre in...



details:   https://anonhg.NetBSD.org/src/rev/905c6e5d5438
branches:  netbsd-8
changeset: 435117:905c6e5d5438
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Jul 13 14:32:01 2018 +0000

description:
Pull up following revision(s) (requested by kre in ticket #907):

        bin/sh/expand.c: revision 1.122

When matching a char class ([[:name:]]) in a pattern (for filename
expansion, case patterrns, etc) do not force '[' to be a member of
every class.

Before this fix, try:

        case [ in [[:alpha:]]) echo Huh\?;; esac

XXX pullup-8    (Perhaps -7 as well, though that shell version has
much more relevant bugs than this one.)  This bug is not in -6 as
that has no charclass support.

diffstat:

 bin/sh/expand.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 1dddbcb090cb -r 905c6e5d5438 bin/sh/expand.c
--- a/bin/sh/expand.c   Fri Jul 13 14:29:15 2018 +0000
+++ b/bin/sh/expand.c   Fri Jul 13 14:32:01 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: expand.c,v 1.110.2.3 2017/10/25 06:51:36 snj Exp $     */
+/*     $NetBSD: expand.c,v 1.110.2.4 2018/07/13 14:32:01 martin Exp $  */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)expand.c   8.5 (Berkeley) 5/15/95";
 #else
-__RCSID("$NetBSD: expand.c,v 1.110.2.3 2017/10/25 06:51:36 snj Exp $");
+__RCSID("$NetBSD: expand.c,v 1.110.2.4 2018/07/13 14:32:01 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -1774,8 +1774,10 @@
                                }
                                if (c == '[' && *p == ':') {
                                        found |= match_charclass(p, chr, &end);
-                                       if (end != NULL)
+                                       if (end != NULL) {
                                                p = end;
+                                               continue;
+                                       }
                                }
                                if (c == CTLESC)
                                        c = *p++;



Home | Main Index | Thread Index | Old Index