NetBSD-Bugs archive

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

Re: toolchain/38315: make: ?= should resolve LHS



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