NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: toolchain/38315: make: ?= should resolve LHS
The following reply was made to PR toolchain/38315; it has been noted by GNATS.
From: Alan Barrett <apb%cequrux.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: sjg%NetBSD.org@localhost, netbsd-bugs%NetBSD.org@localhost
Subject: Re: toolchain/38315: make: ?= should resolve LHS
Date: Thu, 27 Mar 2008 13:51:59 +0200
On Wed, 26 Mar 2008, Simon J. Gerraty wrote:
> v = VarFind(name, ctxt, FIND_CMD|FIND_GLOBAL|FIND_ENV);
>
> if (v == (Var *)NIL) {
> + if (strchr(name, '$') != NULL) {
> + char *cp;
> +
> + cp = Var_Subst(NULL, name, ctxt, FALSE);
> + v = VarFind(cp, ctxt, FIND_CMD|FIND_GLOBAL|FIND_ENV);
> + free(cp);
> + if (v != (Var *)NIL) {
> + goto found;
> + }
> + }
> return(FALSE);
I am not sure about calling VarFind twice. What happens in this case:
DOLLAR = $$
LBRACE = {
RBRACE = }
V.$$ = foo
V.$$${LBRACE}DOLLAR${RBRACE} = bar
V.${DOLLAR} ?= baz
--apb (Alan Barrett)
Home |
Main Index |
Thread Index |
Old Index