summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authorvasiljevic <vasiljevic@noemail.net>2010-04-02 14:30:40 (GMT)
committervasiljevic <vasiljevic@noemail.net>2010-04-02 14:30:40 (GMT)
commit0c7281ae0c286d0e4e5feecf6f1a7f3c0780e536 (patch)
treeda445ad7fe56a54b6db6359e3cb1f14dbcaec86b /generic/tclStringObj.c
parente795219725f8c2dede5535e87f6f0585b4dd6023 (diff)
downloadtcl-0c7281ae0c286d0e4e5feecf6f1a7f3c0780e536.zip
tcl-0c7281ae0c286d0e4e5feecf6f1a7f3c0780e536.tar.gz
tcl-0c7281ae0c286d0e4e5feecf6f1a7f3c0780e536.tar.bz2
* generic/tclStringObj.c: (SetStringFromAny): avoid trampling
over the tclEmptyStringRep->bytes as it is thread-shared (thx to Gustaf Neumann for the (hard) work of locating this one). FossilOrigin-Name: 59bf516261b93edb88571e006ebac224d77a2294
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index ab6a600..f91322c 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -33,7 +33,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStringObj.c,v 1.70.2.20 2010/03/29 21:57:33 dgp Exp $ */
+ * RCS: @(#) $Id: tclStringObj.c,v 1.70.2.21 2010/04/02 14:30:41 vasiljevic Exp $ */
#include "tclInt.h"
#include "tommath.h"
@@ -2948,7 +2948,9 @@ SetStringFromAny(
if (objPtr->bytes != NULL) {
stringPtr->allocated = objPtr->length;
- objPtr->bytes[objPtr->length] = 0;
+ if (objPtr->bytes != tclEmptyStringRep) {
+ objPtr->bytes[objPtr->length] = 0;
+ }
} else {
objPtr->length = 0;
}