summaryrefslogtreecommitdiffstats
path: root/generic/tclResult.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-11-10 01:33:59 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-11-10 01:33:59 (GMT)
commit936c1d7d5f68baa4bde529be7b0d23a8b55a0f25 (patch)
treeca37b79a3640f56ad0a35b1cde300bf1b9050f0a /generic/tclResult.c
parente4ed773766761c658f778f4ea4285266a2870f56 (diff)
downloadtcl-936c1d7d5f68baa4bde529be7b0d23a8b55a0f25.zip
tcl-936c1d7d5f68baa4bde529be7b0d23a8b55a0f25.tar.gz
tcl-936c1d7d5f68baa4bde529be7b0d23a8b55a0f25.tar.bz2
* generic/tclResult.c (ResetObjResult): new shortcut.
Diffstat (limited to 'generic/tclResult.c')
-rw-r--r--generic/tclResult.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclResult.c b/generic/tclResult.c
index ed2a214..1601619 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.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: tclResult.c,v 1.39 2007/10/18 21:16:18 dgp Exp $
+ * RCS: @(#) $Id: tclResult.c,v 1.40 2007/11/10 01:34:00 msofer Exp $
*/
#include "tclInt.h"
@@ -961,9 +961,10 @@ ResetObjResult(
TclNewObj(objResultPtr);
Tcl_IncrRefCount(objResultPtr);
iPtr->objResultPtr = objResultPtr;
+ } else if (objResultPtr->bytes == tclEmptyStringRep) {
+ return;
} else {
- if ((objResultPtr->bytes != NULL)
- && (objResultPtr->bytes != tclEmptyStringRep)) {
+ if (objResultPtr->bytes != NULL) {
ckfree((char *) objResultPtr->bytes);
}
objResultPtr->bytes = tclEmptyStringRep;