Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make(1): fix obscure edge case for ${VAR:e$=x}



details:   https://anonhg.NetBSD.org/src/rev/aa6dfefbdea4
branches:  trunk
changeset: 936177:aa6dfefbdea4
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jul 20 16:32:14 2020 +0000

description:
make(1): fix obscure edge case for ${VAR:e$=x}

The characters "$=" do not occur in either src or pkgsrc, therefore this
case is unlikely to occur in practice.

diffstat:

 usr.bin/make/unit-tests/sysv.exp |   2 +-
 usr.bin/make/var.c               |  12 ++++--------
 2 files changed, 5 insertions(+), 9 deletions(-)

diffs (51 lines):

diff -r 58ae66982bc6 -r aa6dfefbdea4 usr.bin/make/unit-tests/sysv.exp
--- a/usr.bin/make/unit-tests/sysv.exp  Mon Jul 20 16:27:55 2020 +0000
+++ b/usr.bin/make/unit-tests/sysv.exp  Mon Jul 20 16:32:14 2020 +0000
@@ -15,6 +15,6 @@
 ax:Q b c d eb
 bcd.e
 &
-anchor-dollar: valux
+anchor-dollar: value
 anchor-dollar: valux
 exit status 0
diff -r 58ae66982bc6 -r aa6dfefbdea4 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Mon Jul 20 16:27:55 2020 +0000
+++ b/usr.bin/make/var.c        Mon Jul 20 16:32:14 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.283 2020/07/20 16:12:52 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.284 2020/07/20 16:32:14 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.283 2020/07/20 16:12:52 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.284 2020/07/20 16:32:14 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.283 2020/07/20 16:12:52 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.284 2020/07/20 16:32:14 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -3080,12 +3080,8 @@
 
     st->delim = '=';
     st->cp = st->tstr;
-    VarPatternFlags pflags = 0;
-    /* FIXME: There's no point in having a single $ at the end of a
-     * SysV substitution since that will not be interpreted as an
-     * anchor anyway. */
     char *lhs = ParseModifierPart(st->ctxt, &st->cp, st->delim, st->eflags,
-                                 &pflags, NULL, NULL);
+                                 NULL, NULL, NULL);
     if (lhs == NULL)
        return 'c';
 



Home | Main Index | Thread Index | Old Index