make(1): fix unnecessary evaluation for :S :C := modifiers

This commit is contained in:
rillig 2020-07-02 16:46:57 +00:00
parent 935e957525
commit fcdc2c38f9
2 changed files with 6 additions and 9 deletions

View File

@ -4,9 +4,6 @@ expected and empty
expected U23 condition
expected VAR23
expected M pattern
unexpected S modifier
unexpected C modifier
unexpected = modifier
unexpected @ modifier
unexpected @ modifier
unexpected @ modifier

View File

@ -1,4 +1,4 @@
/* $NetBSD: var.c,v 1.231 2020/07/02 16:14:50 rillig Exp $ */
/* $NetBSD: var.c,v 1.232 2020/07/02 16:46:57 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: var.c,v 1.231 2020/07/02 16:14:50 rillig Exp $";
static char rcsid[] = "$NetBSD: var.c,v 1.232 2020/07/02 16:46:57 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
__RCSID("$NetBSD: var.c,v 1.231 2020/07/02 16:14:50 rillig Exp $");
__RCSID("$NetBSD: var.c,v 1.232 2020/07/02 16:46:57 rillig Exp $");
#endif
#endif /* not lint */
#endif
@ -2280,8 +2280,8 @@ VarGetPattern(GNode *ctxt, Var_Parse_State *vpstate MAKE_ATTR_UNUSED,
* delimiter, assume it's a variable
* substitution and recurse.
*/
cp2 = Var_Parse(cp, ctxt, errnum | VARF_WANTRES, &len,
&freeIt);
cp2 = Var_Parse(cp, ctxt, errnum |
(flags & VARF_WANTRES), &len, &freeIt);
Buf_AddBytes(&buf, strlen(cp2), cp2);
free(freeIt);
cp += len - 1;
@ -2292,7 +2292,7 @@ VarGetPattern(GNode *ctxt, Var_Parse_State *vpstate MAKE_ATTR_UNUSED,
/*
* Find the end of this variable reference
* and suck it in without further ado.
* It will be interperated later.
* It will be interpreted later.
*/
int have = *cp2;
int want = (*cp2 == PROPEN) ? PRCLOSE : BRCLOSE;