diff options
author | dgp <dgp@users.sourceforge.net> | 2017-01-27 16:32:19 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2017-01-27 16:32:19 (GMT) |
commit | efca62ee33eb6d14aedf83b1ef974fb7e2f97e4c (patch) | |
tree | e3dc9cbd3a3b728f247996896edafb138d43a756 /generic/tclUtil.c | |
parent | d81aa84636a39436937c7afe12a85d337f3158dc (diff) | |
parent | 368a29cbf01f4aa930631726ce71aafe9c853f12 (diff) | |
download | tcl-efca62ee33eb6d14aedf83b1ef974fb7e2f97e4c.zip tcl-efca62ee33eb6d14aedf83b1ef974fb7e2f97e4c.tar.gz tcl-efca62ee33eb6d14aedf83b1ef974fb7e2f97e4c.tar.bz2 |
merge trunk
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r-- | generic/tclUtil.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index e6cb332..c03c2ca 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -2893,7 +2893,6 @@ Tcl_DStringResult( Tcl_DString *dsPtr) /* Dynamic string that is to become the * result of interp. */ { - Tcl_ResetResult(interp); Tcl_SetObjResult(interp, TclDStringToObj(dsPtr)); } @@ -2923,6 +2922,14 @@ Tcl_DStringGetResult( Tcl_DString *dsPtr) /* Dynamic string that is to become the result * of interp. */ { +#ifdef TCL_NO_DEPRECATED + Tcl_Obj *obj = Tcl_GetObjResult(interp); + const char *bytes = TclGetString(obj); + + Tcl_DStringFree(dsPtr); + Tcl_DStringAppend(dsPtr, bytes, obj->length); + Tcl_ResetResult(interp); +#else Interp *iPtr = (Interp *) interp; if (dsPtr->string != dsPtr->staticSpace) { @@ -2931,7 +2938,7 @@ Tcl_DStringGetResult( /* * Do more efficient transfer when we know the result is a Tcl_Obj. When - * there's no st`ring result, we only have to deal with two cases: + * there's no string result, we only have to deal with two cases: * * 1. When the string rep is the empty string, when we don't copy but * instead use the staticSpace in the DString to hold an empty string. @@ -2994,6 +3001,7 @@ Tcl_DStringGetResult( iPtr->result = iPtr->resultSpace; iPtr->resultSpace[0] = 0; +#endif /* !TCL_NO_DEPRECATED */ } /* @@ -3575,7 +3583,7 @@ TclGetIntForIndex( int *indexPtr) /* Location filled in with an integer * representing an index. */ { - int length; + size_t length; char *opPtr; const char *bytes; @@ -3587,7 +3595,8 @@ TclGetIntForIndex( return TCL_OK; } - bytes = TclGetStringFromObj(objPtr, &length); + bytes = TclGetString(objPtr); + length = objPtr->length; /* * Leading whitespace is acceptable in an index. |