Module Name:    src
Committed By:   rillig
Date:           Sun Jul 19 17:24:22 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk

Log Message:
make(1): demonstrate off-by-one bug in :C modifier


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/make/unit-tests/modmisc.exp
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/modmisc.mk

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/unit-tests/modmisc.exp
diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.15 src/usr.bin/make/unit-tests/modmisc.exp:1.16
--- src/usr.bin/make/unit-tests/modmisc.exp:1.15	Sun Jul 19 15:16:22 2020
+++ src/usr.bin/make/unit-tests/modmisc.exp	Sun Jul 19 17:24:22 2020
@@ -51,4 +51,14 @@ mod-loop-dollar:$3$:
 mod-loop-dollar:$${word}$:
 mod-loop-dollar:$$5$$:
 mod-loop-dollar:$$${word}$$:
+mod-C-limits:00-ok:1 2323 45456
+mod-C-limits:11-missing:1 6
+mod-C-limits:11-ok:1 22 446
+make: No subexpression \2
+make: No subexpression \2
+make: No subexpression \2
+make: No subexpression \2
+mod-C-limits:22-missing:1 6
+mod-C-limits:22-missing:1 6
+mod-C-limits:22-ok:1 33 556
 exit status 0

Index: src/usr.bin/make/unit-tests/modmisc.mk
diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.13 src/usr.bin/make/unit-tests/modmisc.mk:1.14
--- src/usr.bin/make/unit-tests/modmisc.mk:1.13	Sun Jul 19 15:16:22 2020
+++ src/usr.bin/make/unit-tests/modmisc.mk	Sun Jul 19 17:24:22 2020
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.13 2020/07/19 15:16:22 rillig Exp $
+# $Id: modmisc.mk,v 1.14 2020/07/19 17:24:22 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -18,6 +18,7 @@ MOD_SEP=S,:, ,g
 all:	modvar modvarloop modsysv mod-HTE emptyvar undefvar
 all:	mod-S mod-C mod-at-varname mod-at-resolve mod-at-dollar
 all:	mod-subst-dollar mod-loop-dollar
+all:	mod-C-limits
 
 modsysv:
 	@echo "The answer is ${libfoo.a:L:libfoo.a=42}"
@@ -133,3 +134,11 @@ mod-loop-dollar:
 	@echo $@:${:U4:@word@$$$${word}$$$$@:Q}:
 	@echo $@:${:U5:@word@$$$$${word}$$$$$@:Q}:
 	@echo $@:${:U6:@word@$$$$$${word}$$$$$$@:Q}:
+
+mod-C-limits:
+	@echo $@:00-ok:${:U1 23 456:C,..,\0\0,:Q}
+	@echo $@:11-missing:${:U1 23 456:C,..,\1\1,:Q}
+	@echo $@:11-ok:${:U1 23 456:C,(.).,\1\1,:Q}
+	@echo $@:22-missing:${:U1 23 456:C,..,\2\2,:Q}
+	@echo $@:22-missing:${:U1 23 456:C,(.).,\2\2,:Q}
+	@echo $@:22-ok:${:U1 23 456:C,(.)(.),\2\2,:Q}

Reply via email to