From owner-svn-src-all@FreeBSD.ORG Sat May 18 13:07:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 269E0890; Sat, 18 May 2013 13:07:02 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 19C50BE; Sat, 18 May 2013 13:07:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ID71Z4058005; Sat, 18 May 2013 13:07:01 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ID71ab058004; Sat, 18 May 2013 13:07:01 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201305181307.r4ID71ab058004@svn.freebsd.org> From: "Simon J. Gerraty" Date: Sat, 18 May 2013 13:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250770 - head/contrib/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 May 2013 13:07:02 -0000 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;