diff options
author | dgp <dgp@users.sourceforge.net> | 2020-09-20 15:58:58 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2020-09-20 15:58:58 (GMT) |
commit | 7f917c56f757a3a2724bc9f477a6d5c0395bcb57 (patch) | |
tree | cd54ad8b2fe395cdcfcc19468aef719926ba67af /generic/tclProc.c | |
parent | bddd146942a0689cddba2b1d0bd5e0c3cedad709 (diff) | |
parent | 7a56ff406f3244d777f60d9a5e0da1e5e08f3ef9 (diff) | |
download | tcl-7f917c56f757a3a2724bc9f477a6d5c0395bcb57.zip tcl-7f917c56f757a3a2724bc9f477a6d5c0395bcb57.tar.gz tcl-7f917c56f757a3a2724bc9f477a6d5c0395bcb57.tar.bz2 |
Merge 8.6
Diffstat (limited to 'generic/tclProc.c')
-rw-r--r-- | generic/tclProc.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c index 0e49664..7b4f565 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -905,7 +905,6 @@ TclNRUplevelObjCmd( Interp *iPtr = (Interp *) interp; CmdFrame *invoker = NULL; int word = 0; - int havelevel = 0; int result; CallFrame *savedVarFramePtr, *framePtr; Tcl_Obj *objPtr; @@ -919,7 +918,7 @@ TclNRUplevelObjCmd( uplevelSyntax: Tcl_WrongNumArgs(interp, 1, objv, "?level? command ?arg ...?"); return TCL_ERROR; - } else if (objc == 2) { + } else if (!TclHasStringRep(objv[1]) && objc == 2) { int status ,llength; status = Tcl_ListObjLength(interp, objv[1], &llength); if (status == TCL_OK && llength > 1) { @@ -929,28 +928,27 @@ TclNRUplevelObjCmd( if (result == -1) { return TCL_ERROR; } - havelevel = 1; objc -= 1; objv += 1; + goto havelevel; } } - if (!havelevel) { - /* - * Find the level to use for executing the command. - */ + /* + * Find the level to use for executing the command. + */ - result = TclObjGetFrame(interp, objv[1], &framePtr); - if (result == -1) { - return TCL_ERROR; - } - objc -= result + 1; - if (objc == 0) { - goto uplevelSyntax; - } - objv += result + 1; + result = TclObjGetFrame(interp, objv[1], &framePtr); + if (result == -1) { + return TCL_ERROR; + } + objc -= result + 1; + if (objc == 0) { + goto uplevelSyntax; } + objv += result + 1; + havelevel: /* * Modify the interpreter state to execute in the given frame. |