Module Name:    src
Committed By:   rillig
Date:           Sat Nov  7 13:09:13 UTC 2020

Modified Files:
        src/usr.bin/make: arch.c
        src/usr.bin/make/unit-tests: varname.exp

Log Message:
make(1): properly handle errors for malformed archive target names

Error messages don't belong on stdout.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/usr.bin/make/arch.c
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/varname.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/arch.c
diff -u src/usr.bin/make/arch.c:1.162 src/usr.bin/make/arch.c:1.163
--- src/usr.bin/make/arch.c:1.162	Sat Nov  7 13:03:58 2020
+++ src/usr.bin/make/arch.c	Sat Nov  7 13:09:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.162 2020/11/07 13:03:58 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.163 2020/11/07 13:09:13 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -125,7 +125,7 @@
 #include "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.162 2020/11/07 13:03:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.163 2020/11/07 13:09:13 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -276,7 +276,7 @@ Arch_ParseArchive(char **pp, GNodeList *
 	 * so it's better to return failure than allow such things to happen
 	 */
 	if (*cp == '\0') {
-	    printf("No closing parenthesis in archive specification\n");
+	    Parse_Error(PARSE_FATAL, "No closing parenthesis in archive specification");
 	    return FALSE;
 	}
 

Index: src/usr.bin/make/unit-tests/varname.exp
diff -u src/usr.bin/make/unit-tests/varname.exp:1.8 src/usr.bin/make/unit-tests/varname.exp:1.9
--- src/usr.bin/make/unit-tests/varname.exp:1.8	Mon Nov  2 22:59:48 2020
+++ src/usr.bin/make/unit-tests/varname.exp	Sat Nov  7 13:09:13 2020
@@ -8,7 +8,7 @@ Var_Parse: ${:UVAR(((}=	try1 with VARE_U
 Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF)
 Result of ${:UVAR(((} is "VAR(((" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF)
 Global:.ALLTARGETS =  VAR(((=)
-No closing parenthesis in archive specification
+make: "varname.mk" line 30: No closing parenthesis in archive specification
 make: "varname.mk" line 30: Error in archive specification: "VAR"
 Var_Parse: ${:UVAR\(\(\(}=	try2 with VARE_UNDEFERR|VARE_WANTRES
 Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF)

Reply via email to