From a9d8cafeb160316d137181d239ab61b01e679abe Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 6 Aug 2001 19:13:29 +0000 Subject: * [package forget] now forgets all of the package arguments it receives, not stopping when a package is not found. [Bug 415273] --- ChangeLog | 8 +++++++- generic/tclPkg.c | 4 ++-- tests/pkg.test | 10 +++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29d87c6..4e2e8b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ -2001-08-02 Mo DeJong +2001-08-06 Don Porter + + * generic/tclPkg.c: + * tests/pkg.test: [package forget] now forgets all of the + package arguments it receives, not stopping when a package is + not found. [Bug 415273] +2001-08-02 Mo DeJong * generic/tclPlatDecls.h: * win/tclWinPort.h: Revert related changes made to improve diff --git a/generic/tclPkg.c b/generic/tclPkg.c index 0219a2f..9956023 100644 --- a/generic/tclPkg.c +++ b/generic/tclPkg.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclPkg.c,v 1.6 2001/04/04 16:07:21 kennykb Exp $ + * RCS: @(#) $Id: tclPkg.c,v 1.7 2001/08/06 19:13:29 dgp Exp $ */ #include "tclInt.h" @@ -505,7 +505,7 @@ Tcl_PackageObjCmd(dummy, interp, objc, objv) keyString = Tcl_GetString(objv[i]); hPtr = Tcl_FindHashEntry(&iPtr->packageTable, keyString); if (hPtr == NULL) { - return TCL_OK; + continue; } pkgPtr = (Package *) Tcl_GetHashValue(hPtr); Tcl_DeleteHashEntry(hPtr); diff --git a/tests/pkg.test b/tests/pkg.test index 9618ed8..9dd0784 100644 --- a/tests/pkg.test +++ b/tests/pkg.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: pkg.test,v 1.8 2000/04/10 17:19:03 ericm Exp $ +# RCS: @(#) $Id: pkg.test,v 1.9 2001/08/06 19:13:29 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -301,6 +301,14 @@ test pkg-3.5 {Tcl_PackageCmd procedure, "forget" option} { package forget a c lappend result [lsort [package names]] } {{a b c} b} +test pkg-3.5.1 {Tcl_PackageCmd procedure, "forget" option} { + # Test for Bug 415273 + package ifneeded a 1 "I should have been forgotten" + package forget no-such-package a + set x [package ifneeded a 1] + package forget a + set x +} {} test pkg-3.6 {Tcl_PackageCmd procedure, "ifneeded" option} { list [catch {package ifneeded a} msg] $msg } {1 {wrong # args: should be "package ifneeded package version ?script?"}} -- cgit v0.12