summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-02-03 13:28:43 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-02-03 13:28:43 (GMT)
commit6954a8f786583ef8688ed40c560be6dd5125ad12 (patch)
tree04f06bcf3eb91fe6108b50c726dad8088e686e38
parenta5d1f04218f4616cb7cb69db45ea255a0ffed1fc (diff)
downloadtcl-6954a8f786583ef8688ed40c560be6dd5125ad12.zip
tcl-6954a8f786583ef8688ed40c560be6dd5125ad12.tar.gz
tcl-6954a8f786583ef8688ed40c560be6dd5125ad12.tar.bz2
More corrections to the [array unset] command.
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclVar.c13
2 files changed, 11 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 83b65a0..df53649 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-03 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tclVar.c (Tcl_ArrayObjCmd): More corrections for the 'unset'
+ subcommand.
+
2010-02-02 Andreas Kupries <andreask@activestate.com>
* generic/tclCompile.c: [Bug 2933089]: A literal sharing problem with
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 9977975..36db617 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclVar.c,v 1.160.2.8 2010/02/02 16:13:46 dkf Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.160.2.9 2010/02/03 13:28:44 dkf Exp $
*/
#include "tclInt.h"
@@ -3218,9 +3218,7 @@ Tcl_ArrayObjCmd(
*/
if (varPtr2 == protectedVarPtr) {
- if (VarHashRefCount(varPtr2)-- == 1) {
- CleanupVar(varPtr2, varPtr);
- }
+ VarHashRefCount(varPtr2)--;
}
/*
@@ -3249,12 +3247,13 @@ Tcl_ArrayObjCmd(
*/
if (protectedVarPtr) {
- if (VarHashRefCount(protectedVarPtr)-- == 1) {
- CleanupVar(protectedVarPtr, varPtr);
- }
+ VarHashRefCount(protectedVarPtr)--;
+ CleanupVar(protectedVarPtr, varPtr);
}
return TCL_ERROR;
}
+ } else {
+ CleanupVar(varPtr2, varPtr);
}
}
break;