Module Name:    src
Committed By:   rillig
Date:           Thu Jul  2 16:46:57 UTC 2020

Modified Files:
        src/usr.bin/make: var.c
        src/usr.bin/make/unit-tests: cond-short.exp

Log Message:
make(1): fix unnecessary evaluation for :S :C := modifiers


To generate a diff of this commit:
cvs rdiff -u -r1.231 -r1.232 src/usr.bin/make/var.c
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/cond-short.exp

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.231 src/usr.bin/make/var.c:1.232
--- src/usr.bin/make/var.c:1.231	Thu Jul  2 16:14:50 2020
+++ src/usr.bin/make/var.c	Thu Jul  2 16:46:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.231 2020/07/02 16:14:50 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.232 2020/07/02 16:46:57 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.231 2020/07/02 16:14:50 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.232 2020/07/02 16:46:57 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.231 2020/07/02 16:14:50 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.232 2020/07/02 16:46:57 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2280,8 +2280,8 @@ VarGetPattern(GNode *ctxt, Var_Parse_Sta
 		     * delimiter, assume it's a variable
 		     * substitution and recurse.
 		     */
-		    cp2 = Var_Parse(cp, ctxt, errnum | VARF_WANTRES, &len,
-			&freeIt);
+		    cp2 = Var_Parse(cp, ctxt, errnum |
+				    (flags & VARF_WANTRES), &len, &freeIt);
 		    Buf_AddBytes(&buf, strlen(cp2), cp2);
 		    free(freeIt);
 		    cp += len - 1;
@@ -2292,7 +2292,7 @@ VarGetPattern(GNode *ctxt, Var_Parse_Sta
 			/*
 			 * Find the end of this variable reference
 			 * and suck it in without further ado.
-			 * It will be interperated later.
+			 * It will be interpreted later.
 			 */
 			int have = *cp2;
 			int want = (*cp2 == PROPEN) ? PRCLOSE : BRCLOSE;

Index: src/usr.bin/make/unit-tests/cond-short.exp
diff -u src/usr.bin/make/unit-tests/cond-short.exp:1.7 src/usr.bin/make/unit-tests/cond-short.exp:1.8
--- src/usr.bin/make/unit-tests/cond-short.exp:1.7	Thu Jul  2 16:37:56 2020
+++ src/usr.bin/make/unit-tests/cond-short.exp	Thu Jul  2 16:46:57 2020
@@ -4,9 +4,6 @@ expected and empty
 expected U23 condition
 expected VAR23
 expected M pattern
-unexpected S modifier
-unexpected C modifier
-unexpected = modifier
 unexpected @ modifier
 unexpected @ modifier
 unexpected @ modifier

Reply via email to