summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2001-03-13 11:18:48 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2001-03-13 11:18:48 (GMT)
commit9749bcf454c6b66a309171a6b096169d54197534 (patch)
treec2ec2066196e03900ca3937737b8e0f63507e2be
parentcc54e8b692fee89c6fd62359d605a21434c1ab25 (diff)
downloadtcl-9749bcf454c6b66a309171a6b096169d54197534.zip
tcl-9749bcf454c6b66a309171a6b096169d54197534.tar.gz
tcl-9749bcf454c6b66a309171a6b096169d54197534.tar.bz2
Made [unset] command behave as documented when no arguments present.
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclVar.c10
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 494f606..6d441ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2001-03-13 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+ * generic/tclVar.c (Tcl_UnsetObjCmd): Made command behave as
+ documented [issue remaining from bug #405769]
+
* generic/tclCmdMZ.c (Tcl_StringObjCmd): A missing
{return TCL_OK;} was causing memory corruption. [Bug #408002]
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 608185e..bba5e4f 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -14,7 +14,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.28 2001/03/06 14:45:03 dkf Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.29 2001/03/13 11:18:48 dkf Exp $
*/
#include "tclInt.h"
@@ -2609,10 +2609,16 @@ Tcl_UnsetObjCmd(dummy, interp, objc, objv)
register int i, flags = TCL_LEAVE_ERR_MSG;
register char *name;
- if (objc < 2) {
+ if (objc < 1) {
Tcl_WrongNumArgs(interp, 1, objv,
"?-nocomplain? ?--? ?varName varName ...?");
return TCL_ERROR;
+ } else if (objc == 1) {
+ /*
+ * Do nothing if no arguments supplied, so as to match
+ * command documentation.
+ */
+ return TCL_OK;
}
/*