summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/Makefile2
-rw-r--r--usr.bin/make/PSD.doc/tutorial.ms2
-rw-r--r--usr.bin/make/pathnames.h2
-rw-r--r--usr.bin/make/str.c2
-rw-r--r--usr.bin/make/var.c22
5 files changed, 10 insertions, 20 deletions
diff --git a/usr.bin/make/Makefile b/usr.bin/make/Makefile
index c28b6f840dce..d9986d2a1a07 100644
--- a/usr.bin/make/Makefile
+++ b/usr.bin/make/Makefile
@@ -1,5 +1,5 @@
# from: @(#)Makefile 5.2 (Berkeley) 12/28/90
-# $Id: Makefile,v 1.4 1995/06/16 22:46:38 ache Exp $
+# $Id: Makefile,v 1.3.4.1 1995/08/08 04:00:16 ache Exp $
PROG= make
CFLAGS+= -I${.CURDIR} -DPOSIX -DSYSVINCLUDE
diff --git a/usr.bin/make/PSD.doc/tutorial.ms b/usr.bin/make/PSD.doc/tutorial.ms
index eca49d947383..05da5603b4f2 100644
--- a/usr.bin/make/PSD.doc/tutorial.ms
+++ b/usr.bin/make/PSD.doc/tutorial.ms
@@ -43,7 +43,7 @@
.\" is numeric, it is taken as the depth for numbering (as for .NH), else
.\" the default (1) is assumed.
.\"
-.\" $Id: tutorial.ms,v 1.4 89/01/08 20:20:22 adam Exp Locker: adam $
+.\" $Id: tutorial.ms,v 1.1.1.1 1994/05/27 12:32:16 rgrimes Exp $
.\"
.\" @P The initial paragraph distance.
.\" @Q The piece of section number to increment (or 0 if none given)
diff --git a/usr.bin/make/pathnames.h b/usr.bin/make/pathnames.h
index 2c25ead53ed5..b6ec1100dcdd 100644
--- a/usr.bin/make/pathnames.h
+++ b/usr.bin/make/pathnames.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)pathnames.h 5.2 (Berkeley) 6/1/90
- * $Id: pathnames.h,v 1.2 1993/08/01 18:11:58 mycroft Exp $
+ * $Id: pathnames.h,v 1.2 1995/01/23 21:01:52 jkh Exp $
*/
#define _PATH_OBJDIR "obj"
diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c
index 41dd195d8946..14adcbb27ffa 100644
--- a/usr.bin/make/str.c
+++ b/usr.bin/make/str.c
@@ -38,7 +38,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; */
-static char *rcsid = "$Id: str.c,v 1.5 1995/06/18 12:34:12 ache Exp $";
+static char *rcsid = "$Id: str.c,v 1.4.4.1 1995/08/08 04:00:29 ache Exp $";
#endif /* not lint */
#include "make.h"
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index 851a80ccd4c2..c0c9c36982ad 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -147,7 +147,6 @@ typedef struct {
#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 @@ VarSubstitute (word, addSpace, buf, patternp)
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 @@ VarSubstitute (word, addSpace, buf, patternp)
* 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 @@ VarSubstitute (word, addSpace, buf, patternp)
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 @@ VarSubstitute (word, addSpace, buf, patternp)
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: