diff options
Diffstat (limited to 'generic/tclHistory.c')
-rw-r--r-- | generic/tclHistory.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/generic/tclHistory.c b/generic/tclHistory.c index b10d423..47806d4 100644 --- a/generic/tclHistory.c +++ b/generic/tclHistory.c @@ -62,15 +62,14 @@ Tcl_RecordAndEval( * instead of Tcl_Eval. */ { register Tcl_Obj *cmdPtr; - int length = strlen(cmd); int result; - if (length > 0) { + if (cmd[0]) { /* * Call Tcl_RecordAndEvalObj to do the actual work. */ - cmdPtr = Tcl_NewStringObj(cmd, length); + cmdPtr = Tcl_NewStringObj(cmd, -1); Tcl_IncrRefCount(cmdPtr); result = Tcl_RecordAndEvalObj(interp, cmdPtr, flags); @@ -161,7 +160,7 @@ Tcl_RecordAndEvalObj( Tcl_Obj *list[3]; /* - * Do recording by eval'ing a tcl history command: history add $cmd. + * Do recording by eval'ing a tcl history command: history add $cmd. */ list[0] = histObjsPtr->historyObj; @@ -175,7 +174,7 @@ Tcl_RecordAndEvalObj( /* * One possible failure mode above: exceeding a resource limit. */ - + if (Tcl_LimitExceeded(interp)) { return TCL_ERROR; } |