diff options
author | hobbs <hobbs> | 2010-08-27 00:32:28 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2010-08-27 00:32:28 (GMT) |
commit | ed71f62f6d249a1aa1cf0f13c57ae097c2fbe6da (patch) | |
tree | 233efdffa7e7f8782ec5634d73ac0c88d4934c34 | |
parent | 77f1040bfa885893472f496ec67b4dff85cb1da4 (diff) | |
download | tk-ed71f62f6d249a1aa1cf0f13c57ae097c2fbe6da.zip tk-ed71f62f6d249a1aa1cf0f13c57ae097c2fbe6da.tar.gz tk-ed71f62f6d249a1aa1cf0f13c57ae097c2fbe6da.tar.bz2 |
* generic/tkText.c (DumpLine): s/segPtr->size/currentSize/
throughout, but particularly in if lineChanged block where segPtr
may no longer be valid. [Bug 3053347]
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | generic/tkText.c | 12 |
2 files changed, 10 insertions, 6 deletions
@@ -1,5 +1,9 @@ 2010-08-26 Jeff Hobbs <jeffh@ActiveState.com> + * generic/tkText.c (DumpLine): s/segPtr->size/currentSize/ + throughout, but particularly in if lineChanged block where segPtr + may no longer be valid. [Bug 3053347] + * unix/Makefile.in: add valgrind target * unix/configure, unix/tcl.m4: SHLIB_LD_LIBS='${LIBS}' for OSF1-V*. Add /usr/lib64 to set of auto-search dirs. [Bug 1230554] diff --git a/generic/tkText.c b/generic/tkText.c index 0bca141..1b47b28 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkText.c,v 1.79.2.7 2010/03/11 09:29:29 dkf Exp $ + * RCS: @(#) $Id: tkText.c,v 1.79.2.8 2010/08/27 00:32:28 hobbs Exp $ */ #include "default.h" @@ -4649,17 +4649,17 @@ DumpLine( int currentSize = segPtr->size; if ((what & TK_DUMP_TEXT) && (segPtr->typePtr == &tkTextCharType) && - (offset + segPtr->size > startByte)) { - int last = segPtr->size; /* Index of last char in seg. */ + (offset + currentSize > startByte)) { + int last = currentSize; /* Index of last char in seg. */ int first = 0; /* Index of first char in seg. */ - if (offset + segPtr->size > endByte) { + if (offset + currentSize > endByte) { last = endByte - offset; } if (startByte > offset) { first = startByte - offset; } - if (last != segPtr->size) { + if (last != currentSize) { /* * To avoid modifying the string in place we copy over just * the segment that we want. Since DumpSegment can modify the @@ -4768,7 +4768,7 @@ DumpLine( } else { while ((newOffset < endByte) && (newOffset < offset) && (newSegPtr != NULL)) { - newOffset += segPtr->size; + newOffset += currentSize; newSegPtr = newSegPtr->nextPtr; if (segPtr == newSegPtr) { break; |