- Remove more dead code, since VarExpand() is never going to be the same
authorMax Okumoto <okumoto@dragonflybsd.org>
Tue, 15 Feb 2005 11:12:44 +0000 (11:12 +0000)
committerMax Okumoto <okumoto@dragonflybsd.org>
Tue, 15 Feb 2005 11:12:44 +0000 (11:12 +0000)
  as v->var.

usr.bin/make/var.c

index 8582246..12714d7 100644 (file)
@@ -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);
        }
     }
 }