From 96b124a96b6b86d7b6bcdb8ccc9851cd1c133392 Mon Sep 17 00:00:00 2001 From: cc_benny Date: Mon, 27 Mar 2006 13:43:15 +0000 Subject: * generic/tkTextDisp.c (MeasureChars): Fix calculations of start and end of string. [Bugs 1325998, 1456157] --- ChangeLog | 5 +++++ generic/tkTextDisp.c | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c88d7dd..afd40d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-03-27 Benjamin Riefenstahl + + * generic/tkTextDisp.c (MeasureChars): Fix calculations of start and + end of string. [Bugs 1325998, 1456157] + 2006-03-27 Donal K. Fellows * generic/tkImgGIF.c (FileReadGIF): Stop crashes when the first GIF 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. -- cgit v0.12