summaryrefslogtreecommitdiffstats
path: root/generic/tclVar.c
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 /generic/tclVar.c
parentcc54e8b692fee89c6fd62359d605a21434c1ab25 (diff)
downloadtcl-9749bcf454c6b66a309171a6b096169d54197534.zip
tcl-9749bcf454c6b66a309171a6b096169d54197534.tar.gz
tcl-9749bcf454c6b66a309171a6b096169d54197534.tar.bz2
Made [unset] command behave as documented when no arguments present.
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r--generic/tclVar.c10
1 files changed, 8 insertions, 2 deletions
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;
}
/*