Module Name:    src
Committed By:   rillig
Date:           Mon Nov  2 21:15:00 UTC 2020

Modified Files:
        src/usr.bin/make: var.c

Log Message:
make(1): document that skipping a modifier on parse errors is risky


To generate a diff of this commit:
cvs rdiff -u -r1.649 -r1.650 src/usr.bin/make/var.c

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.649 src/usr.bin/make/var.c:1.650
--- src/usr.bin/make/var.c:1.649	Mon Nov  2 20:48:36 2020
+++ src/usr.bin/make/var.c	Mon Nov  2 21:15:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.649 2020/11/02 20:48:36 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.650 2020/11/02 21:15:00 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.649 2020/11/02 20:48:36 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.650 2020/11/02 21:15:00 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -3391,6 +3391,9 @@ ApplyModifiers(
 
 	if (res == AMR_UNKNOWN) {
 	    Error("Unknown modifier '%c'", *mod);
+	    /* Guess the end of the current modifier.
+	     * XXX: Skipping the rest of the modifier hides errors and leads
+	     * to wrong results.  Parsing should rather stop here. */
 	    for (p++; *p != ':' && *p != st.endc && *p != '\0'; p++)
 		continue;
 	    st.newVal = var_Error;

Reply via email to