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): add test for unknown sub-modifier of t...



details:   https://anonhg.NetBSD.org/src/rev/c2b1c410f052
branches:  trunk
changeset: 937065:c2b1c410f052
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 08 13:03:13 2020 +0000

description:
make(1): add test for unknown sub-modifier of the :S modifier

diffstat:

 usr.bin/make/unit-tests/modmisc.exp |  2 ++
 usr.bin/make/unit-tests/modmisc.mk  |  7 ++++++-
 usr.bin/make/var.c                  |  8 ++++----
 3 files changed, 12 insertions(+), 5 deletions(-)

diffs (68 lines):

diff -r e4a4c5b10c35 -r c2b1c410f052 usr.bin/make/unit-tests/modmisc.exp
--- a/usr.bin/make/unit-tests/modmisc.exp       Sat Aug 08 13:00:07 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.exp       Sat Aug 08 13:03:13 2020 +0000
@@ -27,6 +27,8 @@
 12345
 mod-subst-chain:
 A B c.
+make: Unknown modifier 'i'
+.
 mod-regex:
 :a b b c:
 :a b b c:
diff -r e4a4c5b10c35 -r c2b1c410f052 usr.bin/make/unit-tests/modmisc.mk
--- a/usr.bin/make/unit-tests/modmisc.mk        Sat Aug 08 13:00:07 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.mk        Sat Aug 08 13:03:13 2020 +0000
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.34 2020/08/07 20:10:35 rillig Exp $
+# $Id: modmisc.mk,v 1.35 2020/08/08 13:03:13 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -148,6 +148,11 @@
 mod-subst-chain:
        @echo $@:
        @echo ${:Ua b c:S,a,A,S,b,B,}.
+       # There is no 'i' modifier for the :S or :C modifiers.
+       # The error message is "make: Unknown modifier 'i'", which is
+       # kind of correct, although it is mixing the terms for variable
+       # modifiers with the matching modifiers.
+       @echo ${:Uvalue:S,a,x,i}.
 
 mod-regex:
        @echo $@:
diff -r e4a4c5b10c35 -r c2b1c410f052 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sat Aug 08 13:00:07 2020 +0000
+++ b/usr.bin/make/var.c        Sat Aug 08 13:03:13 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.423 2020/08/08 13:00:07 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.424 2020/08/08 13:03:13 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.423 2020/08/08 13:00:07 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.424 2020/08/08 13:03:13 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.423 2020/08/08 13:00:07 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.424 2020/08/08 13:03:13 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1297,7 +1297,7 @@
        return;
     }
 
-    /* unanchored */
+    /* unanchored case, may match more than once */
     while ((match = Str_FindSubstring(word, args->lhs)) != NULL) {
        SepBuf_AddBytesBetween(buf, word, match);
        SepBuf_AddBytes(buf, args->rhs, args->rhsLen);



Home | Main Index | Thread Index | Old Index