Module Name: src
Committed By: rillig
Date: Mon Jul 20 16:32:14 UTC 2020
Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: sysv.exp
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.283 -r1.284 src/usr.bin/make/var.c
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/sysv.exp
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.283 src/usr.bin/make/var.c:1.284
--- src/usr.bin/make/var.c:1.283 Mon Jul 20 16:12:52 2020
+++ src/usr.bin/make/var.c Mon Jul 20 16:32:14 2020
@@ -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 @@ ApplyModifier_SysV(ApplyModifiersState *
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';
Index: src/usr.bin/make/unit-tests/sysv.exp
diff -u src/usr.bin/make/unit-tests/sysv.exp:1.7 src/usr.bin/make/unit-tests/sysv.exp:1.8
--- src/usr.bin/make/unit-tests/sysv.exp:1.7 Mon Jul 20 16:27:55 2020
+++ src/usr.bin/make/unit-tests/sysv.exp Mon Jul 20 16:32:14 2020
@@ -15,6 +15,6 @@ a.c.c
ax:Q b c d eb
bcd.e
&
-anchor-dollar: valux
+anchor-dollar: value
anchor-dollar: valux
exit status 0