From: Max Okumoto Date: Tue, 15 Feb 2005 11:12:44 +0000 (+0000) Subject: - Remove more dead code, since VarExpand() is never going to be the same X-Git-Tag: v2.0.1~8749 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/2ea0a2cd2ac4487429ba7392ff0f568e7ed6b0f9 - Remove more dead code, since VarExpand() is never going to be the same as v->var. --- diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index 85822463f2..12714d742d 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -37,7 +37,7 @@ * * @(#)var.c 8.3 (Berkeley) 3/19/94 * $FreeBSD: src/usr.bin/make/var.c,v 1.83 2005/02/11 10:49:01 harti Exp $ - * $DragonFly: src/usr.bin/make/var.c,v 1.98 2005/02/15 11:11:29 okumoto Exp $ + * $DragonFly: src/usr.bin/make/var.c,v 1.99 2005/02/15 11:12:44 okumoto Exp $ */ /*- @@ -1737,7 +1737,6 @@ Var_Parse(char *foo, GNode *ctxt, Boolean err, size_t *lengthPtr, * We just need to check for the first character and return the * value if it exists. */ - char *result; Var *v; /* Variable in invocation */ char name[2]; @@ -1777,28 +1776,17 @@ Var_Parse(char *foo, GNode *ctxt, Boolean err, size_t *lengthPtr, return (err ? var_Error : varNoError); } } else { + char *result; + + result = VarExpand(v, ctxt, err); + if (v->flags & VAR_FROM_ENV) { - result = VarExpand(v, ctxt, err); - if (result == (char *)Buf_GetAll(v->val, (size_t *)NULL)) { - /* - * Returning the value unmodified, so tell the caller to free - * the thing. - */ - *freePtr = TRUE; - *lengthPtr = 2; - VarDestroy(v, FALSE); - return (result); - } else { - *freePtr = TRUE; - *lengthPtr = 2; - VarDestroy(v, TRUE); - return (result); - } - } else { - *freePtr = TRUE; - *lengthPtr = 2; - return (VarExpand(v, ctxt, err)); + VarDestroy(v, TRUE); } + + *freePtr = TRUE; + *lengthPtr = 2; + return (result); } } }