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

Error messages don't belong on stdout.
This commit is contained in:
rillig 2020-11-07 13:09:13 +00:00
parent 68c0f9fa5d
commit a7c9be28ec
2 changed files with 4 additions and 4 deletions

View File

@ -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 *nodeLst, GNode *ctxt)
* 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;
}

View File

@ -8,7 +8,7 @@ Var_Parse: ${:UVAR(((}= try1 with VARE_UNDEFERR|VARE_WANTRES
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)