diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclCmdAH.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index cc88745..1c2e7ce 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdAH.c,v 1.91 2007/12/13 15:23:15 dgp Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.92 2008/03/07 19:15:57 dgp Exp $ */ #include "tclInt.h" @@ -757,7 +757,6 @@ Tcl_ExprObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *CONST objv[]) /* Argument objects. */ { - register Tcl_Obj *objPtr; Tcl_Obj *resultPtr; int result; @@ -766,10 +765,14 @@ Tcl_ExprObjCmd( return TCL_ERROR; } - objPtr = Tcl_ConcatObj(objc-1, objv+1); - Tcl_IncrRefCount(objPtr); - result = Tcl_ExprObj(interp, objPtr, &resultPtr); - Tcl_DecrRefCount(objPtr); + if (objc == 2) { + result = Tcl_ExprObj(interp, objv[1], &resultPtr); + } else { + Tcl_Obj *objPtr = Tcl_ConcatObj(objc-1, objv+1); + Tcl_IncrRefCount(objPtr); + result = Tcl_ExprObj(interp, objPtr, &resultPtr); + Tcl_DecrRefCount(objPtr); + } if (result == TCL_OK) { Tcl_SetObjResult(interp, resultPtr); |