Module Name: src
Committed By: rillig
Date: Tue Sep 22 19:08:48 UTC 2020
Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: directive-for.exp directive-for.mk
Log Message:
make(1): remove obsolete fix for PR bin/29985
To generate a diff of this commit:
cvs rdiff -u -r1.531 -r1.532 src/usr.bin/make/var.c
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/directive-for.exp
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/directive-for.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.531 src/usr.bin/make/var.c:1.532
--- src/usr.bin/make/var.c:1.531 Tue Sep 22 18:07:58 2020
+++ src/usr.bin/make/var.c Tue Sep 22 19:08:47 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.531 2020/09/22 18:07:58 rillig Exp $ */
+/* $NetBSD: var.c,v 1.532 2020/09/22 19:08:47 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
#include "metachar.h"
/* "@(#)var.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.531 2020/09/22 18:07:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.532 2020/09/22 19:08:47 rillig Exp $");
#define VAR_DEBUG_IF(cond, fmt, ...) \
if (!(DEBUG(VAR) && (cond))) \
@@ -3709,7 +3709,6 @@ char *
Var_Subst(const char *str, GNode *ctxt, VarEvalFlags eflags)
{
Buffer buf; /* Buffer for forming things */
- Boolean trailingBackslash;
/* Set true if an error has already been reported,
* to prevent a plethora of messages when recursing */
@@ -3717,12 +3716,8 @@ Var_Subst(const char *str, GNode *ctxt,
Buf_Init(&buf, 0);
errorReported = FALSE;
- trailingBackslash = FALSE; /* variable ends in \ */
while (*str) {
- if (*str == '\n' && trailingBackslash)
- Buf_AddByte(&buf, ' ');
-
if (*str == '$' && str[1] == '$') {
/*
* A dollar sign may be escaped with another dollar sign.
@@ -3782,7 +3777,6 @@ Var_Subst(const char *str, GNode *ctxt,
val_len = strlen(val);
Buf_AddBytes(&buf, val, val_len);
- trailingBackslash = val_len > 0 && val[val_len - 1] == '\\';
}
free(freeIt);
freeIt = NULL;
Index: src/usr.bin/make/unit-tests/directive-for.exp
diff -u src/usr.bin/make/unit-tests/directive-for.exp:1.3 src/usr.bin/make/unit-tests/directive-for.exp:1.4
--- src/usr.bin/make/unit-tests/directive-for.exp:1.3 Tue Sep 22 18:54:50 2020
+++ src/usr.bin/make/unit-tests/directive-for.exp Tue Sep 22 19:08:48 2020
@@ -1,3 +1,5 @@
make: "directive-for.mk" line 100: outer
make: "directive-for.mk" line 125: a:\ a:\file.txt
+make: "directive-for.mk" line 125: d:\\
+make: "directive-for.mk" line 125: d:\\file.txt
exit status 0
Index: src/usr.bin/make/unit-tests/directive-for.mk
diff -u src/usr.bin/make/unit-tests/directive-for.mk:1.4 src/usr.bin/make/unit-tests/directive-for.mk:1.5
--- src/usr.bin/make/unit-tests/directive-for.mk:1.4 Tue Sep 22 18:54:51 2020
+++ src/usr.bin/make/unit-tests/directive-for.mk Tue Sep 22 19:08:48 2020
@@ -1,4 +1,4 @@
-# $NetBSD: directive-for.mk,v 1.4 2020/09/22 18:54:51 rillig Exp $
+# $NetBSD: directive-for.mk,v 1.5 2020/09/22 19:08:48 rillig Exp $
#
# Tests for the .for directive.
@@ -121,7 +121,7 @@ EXPANSION${plus}= value
# interpreted as part of the code. Because of this, the trailingBackslash
# hack in Var_Subst is no longer needed and as of 2020-09-22, has been
# removed.
-.for path in a:\ a:\file.txt
+.for path in a:\ a:\file.txt d:\\ d:\\file.txt
. info ${path}
.endfor