diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2000-06-23 16:21:45 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2000-06-23 16:21:45 +0000 |
commit | 9fe43896ab7c1ae716cc383807b510e85517c2d8 (patch) | |
tree | 01d9a2d2799900d8eafdd68d6bc692552d2b2d99 /usr.bin/make/cond.c | |
parent | 9dec3f73c83665e70d33f9ae6b9638739eea07ce (diff) |
In various places, VAR_CMD is used to actually mean `no real context',
since lookup will start with VAR_CMD in any case.
This fixes VarFind and Var_Parse to handle ctxt == NULL correctly, and
replace those confusing VAR_CMD with proper NULL pointers.
This patch also handles three small details:
- .CURDIR is necessarily set in VAR_GLOBAL,
- suffix handling for archives copies two hard-coded variables, for
which it can use a quick path,
- typos in TargFreeGN.
Reviewed millert@, miod@.
Diffstat (limited to 'usr.bin/make/cond.c')
-rw-r--r-- | usr.bin/make/cond.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index 94c789ebb91..4f4d2164ce7 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cond.c,v 1.18 2000/06/17 14:38:14 espie Exp $ */ +/* $OpenBSD: cond.c,v 1.19 2000/06/23 16:21:43 espie Exp $ */ /* $NetBSD: cond.c,v 1.7 1996/11/06 17:59:02 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; #else -static char rcsid[] = "$OpenBSD: cond.c,v 1.18 2000/06/17 14:38:14 espie Exp $"; +static char rcsid[] = "$OpenBSD: cond.c,v 1.19 2000/06/23 16:21:43 espie Exp $"; #endif #endif /* not lint */ @@ -235,7 +235,7 @@ CondGetArg(linePtr, argPtr, argLen, func, parens) size_t len; Boolean doFree; - cp2 = Var_Parse(cp, VAR_CMD, TRUE, &len, &doFree); + cp2 = Var_Parse(cp, NULL, TRUE, &len, &doFree); Buf_AddString(&buf, cp2); if (doFree) { @@ -291,7 +291,7 @@ CondDoDefined(argLen, arg) Boolean result; arg[argLen] = '\0'; - if (Var_Value(arg, VAR_CMD) != NULL) + if (Var_Value(arg, NULL) != NULL) result = TRUE; else result = FALSE; @@ -528,7 +528,7 @@ CondToken(doEval) * value in lhs. */ t = Err; - lhs = Var_Parse(condExpr, VAR_CMD, doEval,&varSpecLen,&doFree); + lhs = Var_Parse(condExpr, NULL, doEval,&varSpecLen,&doFree); if (lhs == var_Error) { /* * Even if !doEval, we still report syntax errors, which @@ -632,7 +632,7 @@ do_string_compare: size_t len; Boolean freeIt; - cp2 = Var_Parse(cp, VAR_CMD, doEval,&len, &freeIt); + cp2 = Var_Parse(cp, NULL, doEval,&len, &freeIt); if (cp2 != var_Error) { Buf_AddString(&buf, cp2); if (freeIt) { @@ -685,7 +685,7 @@ do_string_compare: size_t len; Boolean freeIt; - string = Var_Parse(rhs, VAR_CMD, doEval,&len,&freeIt); + string = Var_Parse(rhs, NULL, doEval,&len,&freeIt); if (string == var_Error) { right = 0.0; } else { @@ -817,7 +817,7 @@ error: continue; if (condExpr[arglen] != '\0') { - val = Var_Parse(&condExpr[arglen - 1], VAR_CMD, + val = Var_Parse(&condExpr[arglen - 1], NULL, doEval, &length, &doFree); if (val == var_Error) { t = Err; |