Subject: make - fix :M
To: None <tech-toolchain@netbsd.org>
From: Simon Gerraty <sjg@juniper.net>
List: tech-toolchain
Date: 02/19/2004 18:26:07
Make currently parses this incorrectly:

LIBA=/tmp/liba.a
LIBB=/tmp/libb.a
X_LIBS=${LIBA} ${LIBB}

LIB?=a

all:
	@echo "Got '${X_LIBS:M${LIB${LIB:tu}}}'"

we get:

Got '}}'

rather than:

Got '/tmp/liba.a'

The patch below fixes this.  

--sjg

Index: var.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/var.c,v
retrieving revision 1.86
diff -u -r1.86 var.c
--- var.c	24 Jan 2004 19:58:54 -0000	1.86
+++ var.c	20 Feb 2004 02:21:47 -0000
@@ -2713,7 +2713,7 @@
 		    copy = FALSE;
 		    nest = 1;
 		    for (cp = tstr + 1;
-			 *cp != '\0' && *cp != ':';
+			 *cp != '\0';
 			 cp++)
 		    {
 			if (*cp == '\\' &&