diff options
| author | dgp@users.sourceforge.net <dgp> | 2004-10-06 14:59:00 (GMT) |
|---|---|---|
| committer | dgp@users.sourceforge.net <dgp> | 2004-10-06 14:59:00 (GMT) |
| commit | 0668a70fd357149affddf83f71392e167d3333ba (patch) | |
| tree | 71a0e0114969e45230d047cb6fb0374e8f243c37 /generic/tclEncoding.c | |
| parent | f84c0d682964aa24dbfaa5bc4d86d58e6414ca24 (diff) | |
| download | tcl-0668a70fd357149affddf83f71392e167d3333ba.zip tcl-0668a70fd357149affddf83f71392e167d3333ba.tar.gz tcl-0668a70fd357149affddf83f71392e167d3333ba.tar.bz2 | |
* generic/tclBasic.c:
* generic/tclBinary.c:
* generic/tclCmdAH.c:
* generic/tclCmdIL.c:
* generic/tclCmdMZ.c:
* generic/tclCompExpr.c:
* generic/tclDictObj.c:
* generic/tclEncoding.c:
* generic/tclExecute.c:
* generic/tclFCmd.c:
* generic/tclHistory.c:
* generic/tclIndexObj.c:
* generic/tclInterp.c:
It is a poor practice to directly set or append to the value
of the objResult of an interp, because that value might be
shared, and in that circumstance a Tcl_Panic() will be the
result. Searched for example of this practice and replaced
with safer alternatives, often using the Tcl_AppendResult()
routine that dkf just rehabilitated.
Diffstat (limited to 'generic/tclEncoding.c')
| -rw-r--r-- | generic/tclEncoding.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 558487e..58d898b 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEncoding.c,v 1.23 2004/06/18 20:38:01 dgp Exp $ + * RCS: @(#) $Id: tclEncoding.c,v 1.24 2004/10/06 14:59:00 dgp Exp $ */ #include "tclInt.h" @@ -629,13 +629,7 @@ Tcl_GetEncodingNames(interp) Tcl_DecrRefCount(encodingObj); } - /* - * Clear any values placed in the result by globbing. - */ - - Tcl_ResetResult(interp); - resultPtr = Tcl_GetObjResult(interp); - + resultPtr = Tcl_NewObj(); hPtr = Tcl_FirstHashEntry(&table, &search); while (hPtr != NULL) { Tcl_Obj *strPtr; @@ -645,6 +639,7 @@ Tcl_GetEncodingNames(interp) hPtr = Tcl_NextHashEntry(&search); } Tcl_DeleteHashTable(&table); + Tcl_SetObjResult(interp, resultPtr); } /* |
