diff --git a/usr.bin/make/unit-tests/Makefile b/usr.bin/make/unit-tests/Makefile index df116e2bd1ac..14e4d67bba7e 100644 --- a/usr.bin/make/unit-tests/Makefile +++ b/usr.bin/make/unit-tests/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.3 2003/07/29 08:16:01 sjg Exp $ +# $Id: Makefile,v 1.4 2003/07/29 08:44:42 sjg Exp $ # # Unit tests for make(1) # The main targets are: @@ -31,11 +31,12 @@ mod-ts: @echo 'LIST:ts:S/two/2/="${LIST:ts:S/two/2/}"' @echo 'LIST:S/two/2/:ts="${LIST:S/two/2/:ts}"' @echo 'LIST:ts/:S/two/2/="${LIST:ts/:S/two/2/}"' - @echo 'LIST:ts\n="${LIST:ts\n}"' - @echo 'LIST:ts\t="${LIST:ts\t}"' - @echo 'LIST:ts\012:tu="${LIST:ts\012:tu}"' + @echo "Pretend the '/' in '/n' etc. below are back-slashes." + @echo 'LIST:ts/n="${LIST:ts\n}"' + @echo 'LIST:ts/t="${LIST:ts\t}"' + @echo 'LIST:ts/012:tu="${LIST:ts\012:tu}"' @echo 'LIST:tx="${LIST:tx}"' - @echo 'LIST:ts\a:tu="${LIST:ts\a:tu}"' + @echo 'LIST:ts/a:tu="${LIST:ts\a:tu}"' @echo 'FU_$@="${FU_${@:ts}:ts}"' @echo 'FU_$@:ts:T="${FU_${@:ts}:ts:T}" == cool?' diff --git a/usr.bin/make/unit-tests/test.exp b/usr.bin/make/unit-tests/test.exp index 8f5b3e466824..2b862c94d2c0 100644 --- a/usr.bin/make/unit-tests/test.exp +++ b/usr.bin/make/unit-tests/test.exp @@ -7,24 +7,23 @@ LIST:ts="onetwothreefourfivesix" LIST:ts:S/two/2/="one2threefourfivesix" LIST:S/two/2/:ts="one2threefourfivesix" LIST:ts/:S/two/2/="one/2/three/four/five/six" -LIST:ts\n="one +Pretend the '/' in '/n' etc. below are back-slashes. +LIST:ts/n="one two three four five six" -LIST:ts\t="one two three four five six" -LIST:ts\012:tu="ONE +LIST:ts/t="one two three four five six" +LIST:ts/012:tu="ONE TWO THREE FOUR FIVE SIX" make: Bad modifier `:tx' for LIST -make: Unclosed substitution for LIST (/ missing) LIST:tx="}" make: Bad modifier `:ts\a' for LIST -make: Unclosed substitution for LIST (/ missing) -LIST:ts\a:tu="\a:tu}" +LIST:ts/a:tu="\a:tu}" FU_mod-ts="a/b/cool" FU_mod-ts:ts:T="cool" == cool? diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index e0d324ee6436..72e57fa36b0a 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.76 2003/07/28 22:52:10 sjg Exp $ */ +/* $NetBSD: var.c,v 1.77 2003/07/29 08:44:41 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -39,14 +39,14 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: var.c,v 1.76 2003/07/28 22:52:10 sjg Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.77 2003/07/29 08:44:41 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.76 2003/07/28 22:52:10 sjg Exp $"); +__RCSID("$NetBSD: var.c,v 1.77 2003/07/29 08:44:41 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -2024,6 +2024,8 @@ Var_Parse(const char *str, GNode *ctxt, Boolean err, int *lengthPtr, */ *WR(tstr) = ':'; tstr++; + delim = '\0'; + while (*tstr && *tstr != endc) { char *newStr; /* New value to return */ char termc; /* Character which terminated scan */