diff options
author | nijtmans <nijtmans> | 2008-11-25 23:19:01 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2008-11-25 23:19:01 (GMT) |
commit | 00452d9d7d4d961a4659fc21e69febb307d184f0 (patch) | |
tree | 30839af6e8ba95ccd3b3546349a8e12b36608a0b /generic/tclIO.c | |
parent | 27413e2e6be699ec19189b0c87894f786205deb5 (diff) | |
download | tcl-00452d9d7d4d961a4659fc21e69febb307d184f0.zip tcl-00452d9d7d4d961a4659fc21e69febb307d184f0.tar.gz tcl-00452d9d7d4d961a4659fc21e69febb307d184f0.tar.bz2 |
Eliminate 3 calls to Tcl_SetResult, as
examples how it should have been done.
purpose: contribute in the TIP #340 discussion.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r-- | generic/tclIO.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index b7c7b02..fdd6cba 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.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: tclIO.c,v 1.149 2008/11/25 22:13:34 andreas_kupries Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.150 2008/11/25 23:19:01 nijtmans Exp $ */ #include "tclInt.h" @@ -2383,14 +2383,7 @@ FlushChannel( Tcl_SetErrno(errorCode); if (interp != NULL && !TclChanCaughtErrorBypass(interp, (Tcl_Channel) chanPtr)) { - /* - * Casting away const here is safe because the - * TCL_VOLATILE flag guarantees const treatment of the - * Posix error string. - */ - - Tcl_SetResult(interp, (char *) Tcl_PosixError(interp), - TCL_VOLATILE); + Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_PosixError(interp), -1)); } /* |