Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make/unit-tests make(1): demonstrate obscure edge ca...
details: https://anonhg.NetBSD.org/src/rev/18b77f6948c2
branches: trunk
changeset: 1012059:18b77f6948c2
user: rillig <rillig%NetBSD.org@localhost>
date: Mon Jul 20 16:27:55 2020 +0000
description:
make(1): demonstrate obscure edge case in SysV modifier
diffstat:
usr.bin/make/unit-tests/sysv.exp | 2 ++
usr.bin/make/unit-tests/sysv.mk | 11 +++++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diffs (33 lines):
diff -r 6b4237f4306b -r 18b77f6948c2 usr.bin/make/unit-tests/sysv.exp
--- a/usr.bin/make/unit-tests/sysv.exp Mon Jul 20 16:12:52 2020 +0000
+++ b/usr.bin/make/unit-tests/sysv.exp Mon Jul 20 16:27:55 2020 +0000
@@ -15,4 +15,6 @@
ax:Q b c d eb
bcd.e
&
+anchor-dollar: valux
+anchor-dollar: valux
exit status 0
diff -r 6b4237f4306b -r 18b77f6948c2 usr.bin/make/unit-tests/sysv.mk
--- a/usr.bin/make/unit-tests/sysv.mk Mon Jul 20 16:12:52 2020 +0000
+++ b/usr.bin/make/unit-tests/sysv.mk Mon Jul 20 16:27:55 2020 +0000
@@ -1,6 +1,6 @@
-# $Id: sysv.mk,v 1.7 2020/07/19 22:04:27 rillig Exp $
+# $Id: sysv.mk,v 1.8 2020/07/20 16:27:55 rillig Exp $
-all: foo fun sam bla words ampersand
+all: foo fun sam bla words ampersand anchor-dollar
FOO ?=
FOOBAR = ${FOO:=bar}
@@ -54,3 +54,10 @@
ampersand:
@echo ${:U${a.bcd.e:L:a.%=%}:Q}
@echo ${:U${a.bcd.e:L:a.%=&}:Q}
+
+# Before 2020-07-20, when a SysV modifier was parsed, a single dollar
+# before the '=' was interpreted as an anchor, which doesn't make sense
+# since the anchor was discarded immediately.
+anchor-dollar:
+ @echo $@: ${:U${value:L:e$=x}:Q}
+ @echo $@: ${:U${value:L:e=x}:Q}
Home |
Main Index |
Thread Index |
Old Index