summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-06-16 14:43:16 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-06-16 14:43:16 (GMT)
commitb146fea6c309eba008fed11685a34076a44d1ce0 (patch)
treebf525a7feb0645f99be9c32b26ce8aaf478005d9 /generic
parentfdf4b7c6eef91298ad2b24e4f622229eb10cc9b5 (diff)
downloadtcl-b146fea6c309eba008fed11685a34076a44d1ce0.zip
tcl-b146fea6c309eba008fed11685a34076a44d1ce0.tar.gz
tcl-b146fea6c309eba008fed11685a34076a44d1ce0.tar.bz2
Rework the logic. Equivalent function.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclStringObj.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 261e01f..587ba76 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -2965,32 +2965,22 @@ TclStringCatObjv(
} else {
Tcl_GetStringFromObj(objPtr, &numBytes); /* PANIC? */
- if (numBytes == 0) {
- if (pendingPtr && pendingPtr->bytes) {
- /*
- * Generating string rep of objPtr also
- * generated string rep of pendingPtr.
- */
- if (pendingPtr->length) {
- /* Can this happen? */
- goto foo;
- } else {
- /* string-29.14 */
- first = objc - 1;
- last = 0;
- pendingPtr = NULL;
- }
- }
+ if (numBytes) {
+ last = objc - oc;
+ } else if (pendingPtr == NULL || pendingPtr->bytes == NULL) {
continue;
}
- last = objc - oc;
-foo:
if (pendingPtr) {
Tcl_GetStringFromObj(pendingPtr, &length); /* PANIC? */
pendingPtr = NULL;
}
if (length == 0) {
- first = last;
+ if (numBytes) {
+ first = last;
+ } else {
+ first = objc - 1;
+ last = 0;
+ }
} else if (numBytes > INT_MAX - length) {
goto overflow;
}