Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): properly handle errors for malformed a...



details:   https://anonhg.NetBSD.org/src/rev/a8a8585ae46a
branches:  trunk
changeset: 1016016:a8a8585ae46a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Nov 07 13:09:13 2020 +0000

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

Error messages don't belong on stdout.

diffstat:

 usr.bin/make/arch.c                 |  6 +++---
 usr.bin/make/unit-tests/varname.exp |  2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r a6020261062b -r a8a8585ae46a usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Sat Nov 07 13:03:58 2020 +0000
+++ b/usr.bin/make/arch.c       Sat Nov 07 13:09:13 2020 +0000
@@ -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 @@
         * 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;
        }
 
diff -r a6020261062b -r a8a8585ae46a usr.bin/make/unit-tests/varname.exp
--- a/usr.bin/make/unit-tests/varname.exp       Sat Nov 07 13:03:58 2020 +0000
+++ b/usr.bin/make/unit-tests/varname.exp       Sat Nov 07 13:09:13 2020 +0000
@@ -8,7 +8,7 @@
 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)



Home | Main Index | Thread Index | Old Index