summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorcc_benny <cc_benny>2006-03-27 13:43:15 (GMT)
committercc_benny <cc_benny>2006-03-27 13:43:15 (GMT)
commit96b124a96b6b86d7b6bcdb8ccc9851cd1c133392 (patch)
tree07c290ecf25172b70b6a8e681dad068fa19a328a /generic
parent525f1a7466a169620c320643214fa1bc50809d30 (diff)
downloadtk-96b124a96b6b86d7b6bcdb8ccc9851cd1c133392.zip
tk-96b124a96b6b86d7b6bcdb8ccc9851cd1c133392.tar.gz
tk-96b124a96b6b86d7b6bcdb8ccc9851cd1c133392.tar.bz2
* generic/tkTextDisp.c (MeasureChars): Fix calculations of start and
end of string. [Bugs 1325998, 1456157]
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTextDisp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 779bc60..d330e1d 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkTextDisp.c,v 1.57 2006/03/24 14:58:00 das Exp $
+ * RCS: @(#) $Id: tkTextDisp.c,v 1.58 2006/03/27 13:43:15 cc_benny Exp $
*/
#include "tkPort.h"
@@ -8061,9 +8061,10 @@ MeasureChars(
ch = 0; /* lint. */
curX = startX;
- special = source + rangeStart;
- end = source + rangeLength;
- for (start = source; start < end; ) {
+ start = source + rangeStart;
+ end = start + rangeLength;
+ special = start;
+ while (start < end) {
if (start >= special) {
/*
* Find the next special character in the string.