summaryrefslogtreecommitdiffstats
path: root/generic/tkText.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkText.c')
-rw-r--r--generic/tkText.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index b36b136..2c7eec3 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -4941,9 +4941,20 @@ DumpSegment(
return 0;
} else {
int oldStateEpoch = TkBTreeEpoch(textPtr->sharedTextPtr->tree);
-
- Tcl_VarEval(interp, Tcl_GetString(command), " ", Tcl_GetString(tuple),
- NULL);
+ Tcl_DString buf;
+ int code;
+
+ Tcl_DStringInit(&buf);
+ Tcl_DStringAppend(&buf, Tcl_GetString(command), -1);
+ Tcl_DStringAppend(&buf, " ", -1);
+ Tcl_DStringAppend(&buf, Tcl_GetString(tuple), -1);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
+ Tcl_DStringFree(&buf);
+ if (code != TCL_OK) {
+ Tcl_AddErrorInfo(interp,
+ "\n (segment dumping command executed by text)");
+ Tcl_BackgroundException(interp, code);
+ }
Tcl_DecrRefCount(tuple);
return ((textPtr->flags & DESTROYED) ||
TkBTreeEpoch(textPtr->sharedTextPtr->tree) != oldStateEpoch);