summaryrefslogtreecommitdiffstats
path: root/generic/tclVar.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r--generic/tclVar.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index c160c84..608185e 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.27 2000/11/17 11:06:53 dkf Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.28 2001/03/06 14:45:03 dkf Exp $
*/
#include "tclInt.h"
@@ -2611,23 +2611,29 @@ Tcl_UnsetObjCmd(dummy, interp, objc, objv)
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv,
- "?--? ?-nocomplain? ?varName varName ...?");
+ "?-nocomplain? ?--? ?varName varName ...?");
return TCL_ERROR;
}
/*
- * Very simple, restrictive argument parsing. The only options are
- * -- and -nocomplain (which must come first to be an option).
+ * Simple, restrictive argument parsing. The only options are --
+ * and -nocomplain (which must come first and be given exactly to
+ * be an option).
*/
i = 1;
name = TclGetString(objv[i]);
- if ((name[0] == '-') && (strcmp("-nocomplain", name) == 0)) {
- flags = 0;
- i++;
- name = TclGetString(objv[i]);
- }
- if ((name[0] == '-') && (strcmp("--", name) == 0)) {
- i++;
+ if (name[0] == '-') {
+ if (strcmp("-nocomplain", name) == 0) {
+ i++;
+ if (i == objc) {
+ return TCL_OK;
+ }
+ flags = 0;
+ name = TclGetString(objv[i]);
+ }
+ if (strcmp("--", name) == 0) {
+ i++;
+ }
}
for (; i < objc; i++) {