summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authorhobbs <hobbs>1999-09-02 16:26:33 (GMT)
committerhobbs <hobbs>1999-09-02 16:26:33 (GMT)
commitdda9412829471d1e8b6666f67ad5f9e6b74f37cf (patch)
tree4fa94ab0ae4f915245091718248d0bcce74f1e22 /generic/tclStringObj.c
parent8de7074c8b742a0793dfabbe010cd53d4616f0b1 (diff)
downloadtcl-dda9412829471d1e8b6666f67ad5f9e6b74f37cf.zip
tcl-dda9412829471d1e8b6666f67ad5f9e6b74f37cf.tar.gz
tcl-dda9412829471d1e8b6666f67ad5f9e6b74f37cf.tar.bz2
1999-09-01 Jeff Hobbs <hobbs@scriptics.com>
* generic/tclParseExpr.c: changed '"' to '\"' to make FreeBSD happy [Bug: 2625] * generic/tclProc.c: moved static buf to better location and changed static msg that would overflow in ProcessProcResultCode [Bug: 2483] and added Tcl_DStringFree to Tcl_ProcObjCmd. Also reworked size of static buffers. * tests/stringObj.test: added test 9.11 * generic/tclStringObj.c: changed Tcl_AppendObjToObj to properly handle the 1-byte dest and mixed src case where both had had Unicode string len checks made on them. [Bug: 2678]
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 95e83dc..bc18fb3 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.12 1999/06/16 00:47:56 hershey Exp $ */
+ * RCS: @(#) $Id: tclStringObj.c,v 1.13 1999/09/02 16:26:34 hobbs Exp $ */
#include "tclInt.h"
@@ -334,7 +334,7 @@ Tcl_GetCharLength(objPtr)
if (stringPtr->numChars == objPtr->length) {
/*
- * Since we've just calucalated the number of chars, and all
+ * Since we've just calculated the number of chars, and all
* UTF chars are 1-byte long, we don't need to store the
* unicode string.
*/
@@ -916,17 +916,18 @@ Tcl_AppendObjToObj(objPtr, appendObjPtr)
* number of characters in the final (appended-to) object.
*/
+ bytes = Tcl_GetStringFromObj(appendObjPtr, &length);
+
allOneByteChars = 0;
numChars = stringPtr->numChars;
if ((numChars >= 0) && (appendObjPtr->typePtr == &tclStringType)) {
stringPtr = GET_STRING(appendObjPtr);
- if (stringPtr->numChars >= 0) {
+ if ((stringPtr->numChars >= 0) && (stringPtr->numChars == length)) {
numChars += stringPtr->numChars;
allOneByteChars = 1;
}
}
-
- bytes = Tcl_GetStringFromObj(appendObjPtr, &length);
+
AppendUtfToUtfRep(objPtr, bytes, length);
if (allOneByteChars) {