diff options
author | vasiljevic <zv@archiware.com> | 2010-04-02 14:36:45 (GMT) |
---|---|---|
committer | vasiljevic <zv@archiware.com> | 2010-04-02 14:36:45 (GMT) |
commit | 33c80d193b532ae8d2f2f8f1459bb9eaacbd4569 (patch) | |
tree | ff11d52134fb0af8829ca9c050163e02263fb861 | |
parent | 4d8d10a3839ee12d865c3ec30a29b2384e9ddfdf (diff) | |
download | tcl-33c80d193b532ae8d2f2f8f1459bb9eaacbd4569.zip tcl-33c80d193b532ae8d2f2f8f1459bb9eaacbd4569.tar.gz tcl-33c80d193b532ae8d2f2f8f1459bb9eaacbd4569.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).
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclStringObj.c | 6 |
2 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2010-04-02 Zoran Vasiljevic <vasiljevic@users.sourceforge.net> + + * 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). + 2010-03-01 Alexandre Ferrieux <ferrieux@users.sourceforge.net> * unix/tclUnixChan.c: [backported] Refrain from a possibly lengthy diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 19f8723..dcdf1eb 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.32.2.12 2009/04/22 17:21:10 andreas_kupries Exp $ */ + * RCS: @(#) $Id: tclStringObj.c,v 1.32.2.13 2010/04/02 14:36:46 vasiljevic Exp $ */ #include "tclInt.h" @@ -1869,7 +1869,9 @@ SetStringFromAny(interp, objPtr) 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; } |