svn commit: r250770 - head/contrib/bmake

Simon J. Gerraty sjg at FreeBSD.org
Sat May 18 13:07:02 UTC 2013


Author: sjg
Date: Sat May 18 13:07:01 2013
New Revision: 250770
URL: http://svnweb.freebsd.org/changeset/base/250770

Log:
  Var_Delete: expand name to delete if needed.

Modified:
  head/contrib/bmake/var.c

Modified: head/contrib/bmake/var.c
==============================================================================
--- head/contrib/bmake/var.c	Sat May 18 12:54:37 2013	(r250769)
+++ head/contrib/bmake/var.c	Sat May 18 13:07:01 2013	(r250770)
@@ -540,11 +540,20 @@ void
 Var_Delete(const char *name, GNode *ctxt)
 {
     Hash_Entry 	  *ln;
-
-    ln = Hash_FindEntry(&ctxt->context, name);
+    char *cp;
+    
+    if (strchr(name, '$')) {
+	cp = Var_Subst(NULL, name, VAR_GLOBAL, 0);
+    } else {
+	cp = name;
+    }
+    ln = Hash_FindEntry(&ctxt->context, cp);
     if (DEBUG(VAR)) {
 	fprintf(debug_file, "%s:delete %s%s\n",
-	    ctxt->name, name, ln ? "" : " (not found)");
+	    ctxt->name, cp, ln ? "" : " (not found)");
+    }
+    if (cp != name) {
+	free(cp);
     }
     if (ln != NULL) {
 	Var 	  *v;


More information about the svn-src-all mailing list