Module Name:    src
Committed By:   rillig
Date:           Mon Dec 21 21:04:18 UTC 2020

Modified Files:
        src/usr.bin/make: var.c
        src/usr.bin/make/unit-tests: varmod-gmtime.exp varmod-localtime.exp
            varmod-range.exp varmod-to-separator.exp

Log Message:
make(1): remove excess newline from parse errors (since 2020-11-01)

For the modifiers :gmtime and :localtime, the excess newline had been
added in var.c 1.631 from 2020-10-31 21:40:20.

For the modifiers :range and :ts, the excess newline had been added in
var.c 1.635 from 2020-11-01 14:36:25.


To generate a diff of this commit:
cvs rdiff -u -r1.760 -r1.761 src/usr.bin/make/var.c
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/varmod-gmtime.exp
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/varmod-localtime.exp \
    src/usr.bin/make/unit-tests/varmod-range.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varmod-to-separator.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.760 src/usr.bin/make/var.c:1.761
--- src/usr.bin/make/var.c:1.760	Mon Dec 21 02:38:57 2020
+++ src/usr.bin/make/var.c	Mon Dec 21 21:04:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.760 2020/12/21 02:38:57 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.761 2020/12/21 21:04:18 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.760 2020/12/21 02:38:57 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.761 2020/12/21 21:04:18 rillig Exp $");
 
 typedef enum VarFlags {
 	VAR_NONE	= 0,
@@ -2349,7 +2349,7 @@ ApplyModifier_Gmtime(const char **pp, co
 		const char *arg = mod + 7;
 		if (!TryParseTime(&arg, &utc)) {
 			Parse_Error(PARSE_FATAL,
-			    "Invalid time value: %s\n", mod + 7);
+			    "Invalid time value: %s", mod + 7);
 			return AMR_CLEANUP;
 		}
 		*pp = arg;
@@ -2376,7 +2376,7 @@ ApplyModifier_Localtime(const char **pp,
 		const char *arg = mod + 10;
 		if (!TryParseTime(&arg, &utc)) {
 			Parse_Error(PARSE_FATAL,
-			    "Invalid time value: %s\n", mod + 10);
+			    "Invalid time value: %s", mod + 10);
 			return AMR_CLEANUP;
 		}
 		*pp = arg;
@@ -2469,7 +2469,7 @@ ApplyModifier_Range(const char **pp, con
 		const char *p = mod + 6;
 		if (!TryParseSize(&p, &n)) {
 			Parse_Error(PARSE_FATAL,
-			    "Invalid number: %s\n", mod + 6);
+			    "Invalid number: %s", mod + 6);
 			return AMR_CLEANUP;
 		}
 		*pp = p;
@@ -2786,7 +2786,7 @@ ApplyModifier_ToSep(const char **pp, con
 
 		if (!TryParseChar(&p, base, &st->sep)) {
 			Parse_Error(PARSE_FATAL,
-			    "Invalid character number: %s\n", p);
+			    "Invalid character number: %s", p);
 			return AMR_CLEANUP;
 		}
 		if (*p != ':' && *p != st->endc) {

Index: src/usr.bin/make/unit-tests/varmod-gmtime.exp
diff -u src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.9 src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.10
--- src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.9	Mon Dec 21 20:47:29 2020
+++ src/usr.bin/make/unit-tests/varmod-gmtime.exp	Mon Dec 21 21:04:18 2020
@@ -1,17 +1,12 @@
 make: "varmod-gmtime.mk" line 60: Invalid time value: ${:U1593536400}} != "mtime=11593536400}"
-
 make: "varmod-gmtime.mk" line 60: Malformed conditional (${%Y:L:gmtime=${:U1593536400}} != "mtime=11593536400}")
 make: "varmod-gmtime.mk" line 70: Invalid time value: -1} != ""
-
 make: "varmod-gmtime.mk" line 70: Malformed conditional (${:L:gmtime=-1} != "")
 make: "varmod-gmtime.mk" line 79: Invalid time value:  1} != ""
-
 make: "varmod-gmtime.mk" line 79: Malformed conditional (${:L:gmtime= 1} != "")
 make: "varmod-gmtime.mk" line 118: Invalid time value: 10000000000000000000000000000000} != ""
-
 make: "varmod-gmtime.mk" line 118: Malformed conditional (${:L:gmtime=10000000000000000000000000000000} != "")
 make: "varmod-gmtime.mk" line 129: Invalid time value: error} != ""
-
 make: "varmod-gmtime.mk" line 129: Malformed conditional (${:L:gmtime=error} != "")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests

Index: src/usr.bin/make/unit-tests/varmod-localtime.exp
diff -u src/usr.bin/make/unit-tests/varmod-localtime.exp:1.6 src/usr.bin/make/unit-tests/varmod-localtime.exp:1.7
--- src/usr.bin/make/unit-tests/varmod-localtime.exp:1.6	Mon Dec 21 20:47:29 2020
+++ src/usr.bin/make/unit-tests/varmod-localtime.exp	Mon Dec 21 21:04:18 2020
@@ -1,17 +1,12 @@
 make: "varmod-localtime.mk" line 60: Invalid time value: ${:U1593536400}} != "mtime=11593536400}"
-
 make: "varmod-localtime.mk" line 60: Malformed conditional (${%Y:L:localtime=${:U1593536400}} != "mtime=11593536400}")
 make: "varmod-localtime.mk" line 70: Invalid time value: -1} != ""
-
 make: "varmod-localtime.mk" line 70: Malformed conditional (${:L:localtime=-1} != "")
 make: "varmod-localtime.mk" line 79: Invalid time value:  1} != ""
-
 make: "varmod-localtime.mk" line 79: Malformed conditional (${:L:localtime= 1} != "")
 make: "varmod-localtime.mk" line 118: Invalid time value: 10000000000000000000000000000000} != ""
-
 make: "varmod-localtime.mk" line 118: Malformed conditional (${:L:localtime=10000000000000000000000000000000} != "")
 make: "varmod-localtime.mk" line 129: Invalid time value: error} != ""
-
 make: "varmod-localtime.mk" line 129: Malformed conditional (${:L:localtime=error} != "")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
Index: src/usr.bin/make/unit-tests/varmod-range.exp
diff -u src/usr.bin/make/unit-tests/varmod-range.exp:1.6 src/usr.bin/make/unit-tests/varmod-range.exp:1.7
--- src/usr.bin/make/unit-tests/varmod-range.exp:1.6	Sun Dec 20 19:47:34 2020
+++ src/usr.bin/make/unit-tests/varmod-range.exp	Mon Dec 21 21:04:18 2020
@@ -1,5 +1,4 @@
 make: "varmod-range.mk" line 53: Invalid number: x}Rest" != "Rest"
-
 make: "varmod-range.mk" line 53: Malformed conditional ("${:U:range=x}Rest" != "Rest")
 make: "varmod-range.mk" line 62: Unknown modifier 'x'
 make: "varmod-range.mk" line 62: Malformed conditional ("${:U:range=0x0}Rest" != "Rest")

Index: src/usr.bin/make/unit-tests/varmod-to-separator.exp
diff -u src/usr.bin/make/unit-tests/varmod-to-separator.exp:1.5 src/usr.bin/make/unit-tests/varmod-to-separator.exp:1.6
--- src/usr.bin/make/unit-tests/varmod-to-separator.exp:1.5	Sun Nov  1 14:36:25 2020
+++ src/usr.bin/make/unit-tests/varmod-to-separator.exp	Mon Dec 21 21:04:18 2020
@@ -1,8 +1,6 @@
 make: "varmod-to-separator.mk" line 107: Invalid character number: 400:tu}
-
 make: "varmod-to-separator.mk" line 107: Malformed conditional (${WORDS:[1..3]:ts\400:tu})
 make: "varmod-to-separator.mk" line 121: Invalid character number: 100:tu}
-
 make: "varmod-to-separator.mk" line 121: Malformed conditional (${WORDS:[1..3]:ts\x100:tu})
 make: Bad modifier `:ts\-300' for WORDS
 make: "varmod-to-separator.mk" line 128: Malformed conditional (${WORDS:[1..3]:ts\-300:tu})

Reply via email to