From owner-freebsd-stable Thu Nov 21 04:38:54 1996 Return-Path: owner-stable Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id EAA21487 for stable-outgoing; Thu, 21 Nov 1996 04:38:54 -0800 (PST) Received: from dfw-ix2.ix.netcom.com (dfw-ix2.ix.netcom.com [206.214.98.2]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id EAA21482 for ; Thu, 21 Nov 1996 04:38:51 -0800 (PST) Received: from silvia.HIP.Berkeley.EDU (wck-ca6-09.ix.netcom.com [199.35.213.201]) by dfw-ix2.ix.netcom.com (8.6.13/8.6.12) with ESMTP id EAA20119 for ; Thu, 21 Nov 1996 04:38:17 -0800 Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.8.2/8.6.9) id EAA01787; Thu, 21 Nov 1996 04:38:16 -0800 (PST) Date: Thu, 21 Nov 1996 04:38:16 -0800 (PST) Message-Id: <199611211238.EAA01787@silvia.HIP.Berkeley.EDU> To: stable@freebsd.org Subject: urgent: make patch From: asami@freebsd.org (Satoshi Asami) Sender: owner-stable@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I just found out that the latest bsd.port.mk doesn't work on -stable because the :S fix by Adam is not in that version. Can someone test this real quick before I commit it to the -stable branch? I tested it here with some ports but I want to make sure this doesn't break anything. (A make world would be nice.) Satoshi ------- Index: var.c =================================================================== RCS file: /usr/cvs/src/usr.bin/make/var.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- var.c 1995/06/18 12:34:14 1.4 +++ var.c 1995/11/01 12:18:32 1.5 @@ -147,7 +147,6 @@ #define VAR_SUB_GLOBAL 1 /* Apply substitution globally */ #define VAR_MATCH_START 2 /* Match at start of word */ #define VAR_MATCH_END 4 /* Match at end of word */ -#define VAR_NO_SUB 8 /* Substitution is non-global and already done */ } VarPattern; static int VarCmp __P((ClientData, ClientData)); @@ -883,9 +882,9 @@ VarPattern *pattern = (VarPattern *) patternp; wordLen = strlen(word); - if ((pattern->flags & VAR_NO_SUB) == 0) { + if (1) { /* substitute in each word of the variable */ /* - * Still substituting -- break it down into simple anchored cases + * Break substitution down into simple anchored cases * and if none of them fits, perform the general substitution case. */ if ((pattern->flags & VAR_MATCH_START) && @@ -967,7 +966,7 @@ * Pattern is unanchored: search for the pattern in the word using * String_FindSubstring, copying unmatched portions and the * right-hand-side for each match found, handling non-global - * subsititutions correctly, etc. When the loop is done, any + * substitutions correctly, etc. When the loop is done, any * remaining part of the word (word and wordLen are adjusted * accordingly through the loop) is copied straight into the * buffer. @@ -990,13 +989,9 @@ Buf_AddBytes(buf, pattern->rightLen, (Byte *)pattern->rhs); wordLen -= (cp - word) + pattern->leftLen; word = cp + pattern->leftLen; - if (wordLen == 0) { + if (wordLen == 0 || (pattern->flags & VAR_SUB_GLOBAL) == 0){ done = TRUE; } - if ((pattern->flags & VAR_SUB_GLOBAL) == 0) { - done = TRUE; - pattern->flags |= VAR_NO_SUB; - } } else { done = TRUE; } @@ -1015,14 +1010,9 @@ return ((Buf_Size(buf) != origSize) || addSpace); } /* - * Common code for anchored substitutions: if performed a substitution - * and it's not supposed to be global, mark the pattern as requiring - * no more substitutions. addSpace was set TRUE if characters were - * added to the buffer. + * Common code for anchored substitutions: + * addSpace was set TRUE if characters were added to the buffer. */ - if ((pattern->flags & VAR_SUB_GLOBAL) == 0) { - pattern->flags |= VAR_NO_SUB; - } return (addSpace); } nosub: