summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-02-16 12:07:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-02-16 12:07:42 (GMT)
commit5fd34b88068d8c84b8d32ebd8cde63e0bfcdde70 (patch)
tree427dc19789dcdc4da09ade245d638497f0a362cb /generic
parent999decddb383b6dbe467570cb9e3997a48286fa2 (diff)
downloadtcl-5fd34b88068d8c84b8d32ebd8cde63e0bfcdde70.zip
tcl-5fd34b88068d8c84b8d32ebd8cde63e0bfcdde70.tar.gz
tcl-5fd34b88068d8c84b8d32ebd8cde63e0bfcdde70.tar.bz2
Fix bug in previous commit: Don't update stringPtr->numChars when doing a "string reverse", because TclUtfToUCS4() doesn't count surrogate pairs as 2
Diffstat (limited to 'generic')
-rw-r--r--generic/tclStringObj.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index bdc9c99..0e1acf0 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -3003,7 +3003,6 @@ TclStringReverse(
* Pass 1. Reverse the bytes of each multi-byte character.
*/
- int charCount = 0;
int bytesLeft = numBytes;
int chw;
@@ -3021,11 +3020,9 @@ TclStringReverse(
to += bytesInChar;
from += bytesInChar;
bytesLeft -= bytesInChar;
- charCount++;
}
from = to = objPtr->bytes;
- stringPtr->numChars = charCount;
}
/* Pass 2. Reverse all the bytes. */
ReverseBytes((unsigned char *)to, (unsigned char *)from, numBytes);