summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-01-24 11:59:28 (GMT)
committervincentdarley <vincentdarley>2003-01-24 11:59:28 (GMT)
commitd52dfb6c70dc389c6e212ed49b127d02fe683681 (patch)
tree0edec3ad21f600e64fd4bd817c121ab1cadb4505 /generic/tclIO.c
parentc17811ad85f1e8bacc89e6ae99ef8a719de46a66 (diff)
downloadtcl-d52dfb6c70dc389c6e212ed49b127d02fe683681.zip
tcl-d52dfb6c70dc389c6e212ed49b127d02fe683681.tar.gz
tcl-d52dfb6c70dc389c6e212ed49b127d02fe683681.tar.bz2
stringObj unicode Tcl_SetObjLength fixes
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 912a651..e1298d5 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.57 2002/07/30 18:36:25 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.58 2003/01/24 11:59:29 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -4388,6 +4388,12 @@ DoReadChars(chanPtr, objPtr, toRead, appendFlag)
Tcl_SetByteArrayLength(objPtr, 0);
} else {
Tcl_SetObjLength(objPtr, 0);
+ /*
+ * We're going to access objPtr->bytes directly, so
+ * we must ensure that this is actually a string
+ * object (otherwise it might have been pure Unicode).
+ */
+ Tcl_GetString(objPtr);
}
offset = 0;
} else {