diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-12-17 12:45:19 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-12-17 12:45:19 (GMT) |
commit | 9cbf765d3e88d3b7fae05fe2337f82c5486c1a11 (patch) | |
tree | 1b82f966907aeda1a5a2c846ed0019fe6f032cad /generic/tclIOCmd.c | |
parent | 3ee25b501bc980e710bef83abee8153f62114640 (diff) | |
download | tcl-9cbf765d3e88d3b7fae05fe2337f82c5486c1a11.zip tcl-9cbf765d3e88d3b7fae05fe2337f82c5486c1a11.tar.gz tcl-9cbf765d3e88d3b7fae05fe2337f82c5486c1a11.tar.bz2 |
remove deprecated functions Tcl_VarEval and Tcl_VarEvalVA
Diffstat (limited to 'generic/tclIOCmd.c')
-rw-r--r-- | generic/tclIOCmd.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index f738b1a..27f156f 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -1324,11 +1324,11 @@ AcceptCallbackProc( if (acceptCallbackPtr->interp != NULL) { char portBuf[TCL_INTEGER_SPACE]; - char *script = acceptCallbackPtr->script; + Tcl_Obj *script = Tcl_NewStringObj(acceptCallbackPtr->script, -1); Tcl_Interp *interp = acceptCallbackPtr->interp; int result; - Tcl_Preserve(script); + Tcl_IncrRefCount(script); Tcl_Preserve(interp); TclFormatInt(portBuf, port); @@ -1341,8 +1341,12 @@ AcceptCallbackProc( Tcl_RegisterChannel(NULL, chan); - result = Tcl_VarEval(interp, script, " ", Tcl_GetChannelName(chan), - " ", address, " ", portBuf, NULL); + result = Tcl_ListObjAppendElement(interp, script, Tcl_NewStringObj(Tcl_GetChannelName(chan), -1)); + if (result == TCL_OK) { + Tcl_ListObjAppendElement(NULL, script, Tcl_NewStringObj(address, -1)); + Tcl_ListObjAppendElement(NULL, script, Tcl_NewStringObj(portBuf, -1)); + result = Tcl_EvalObjEx(interp, script, 0); + } if (result != TCL_OK) { Tcl_BackgroundException(interp, result); Tcl_UnregisterChannel(interp, chan); @@ -1356,7 +1360,7 @@ AcceptCallbackProc( Tcl_UnregisterChannel(NULL, chan); Tcl_Release(interp); - Tcl_Release(script); + Tcl_DecrRefCount(script); } else { /* * The interpreter has been deleted, so there is no useful way to use |