summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2009-02-15 23:13:11 (GMT)
committerdgp <dgp@users.sourceforge.net>2009-02-15 23:13:11 (GMT)
commit53a6c6e15b5a20bc8c7bb870aba701855f8da484 (patch)
tree1edcef987184945f8a7f58505afb8ae295520675 /generic/tclStringObj.c
parent6c361fffabf21b1adb6113a86da85c4dc64a9f9d (diff)
downloadtcl-53a6c6e15b5a20bc8c7bb870aba701855f8da484.zip
tcl-53a6c6e15b5a20bc8c7bb870aba701855f8da484.tar.gz
tcl-53a6c6e15b5a20bc8c7bb870aba701855f8da484.tar.bz2
* generic/tclStringObj.c: Factor out duplicate code from
Tcl_AppendObjToObj.
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index df4e9fc..1bfe70d 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.107 2009/02/15 22:32:19 dgp Exp $ */
+ * RCS: @(#) $Id: tclStringObj.c,v 1.108 2009/02/15 23:13:11 dgp Exp $ */
#include "tclInt.h"
#include "tommath.h"
@@ -1249,18 +1249,10 @@ Tcl_AppendObjToObj(
*/
if (appendObjPtr->typePtr == &tclStringType) {
- stringPtr = GET_STRING(appendObjPtr);
- if (stringPtr->hasUnicode == 0) {
- /*
- * If appendObjPtr is a string obj with no valid Unicode rep,
- * then fill its unicode rep.
- */
+ Tcl_UniChar *unicode =
+ Tcl_GetUnicodeFromObj(appendObjPtr, &numChars);
- FillUnicodeRep(appendObjPtr);
- stringPtr = GET_STRING(appendObjPtr);
- }
- AppendUnicodeToUnicodeRep(objPtr, stringPtr->unicode,
- stringPtr->numChars);
+ AppendUnicodeToUnicodeRep(objPtr, unicode, numChars);
} else {
bytes = TclGetStringFromObj(appendObjPtr, &length);
AppendUtfToUnicodeRep(objPtr, bytes, length);