diff options
author | hobbs <hobbs> | 2010-08-27 00:33:12 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2010-08-27 00:33:12 (GMT) |
commit | 6569ef8ed20b5e054726506b892bf2aafcc00e6d (patch) | |
tree | 4e7bb7cabd77abf48a771bf16f208cff4e1b5b22 | |
parent | b8b5b04c76a16294ca5b57e96db9764b22d861c9 (diff) | |
download | tk-6569ef8ed20b5e054726506b892bf2aafcc00e6d.zip tk-6569ef8ed20b5e054726506b892bf2aafcc00e6d.tar.gz tk-6569ef8ed20b5e054726506b892bf2aafcc00e6d.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 | 6 | ||||
-rw-r--r-- | generic/tkText.c | 12 |
2 files changed, 12 insertions, 6 deletions
@@ -1,3 +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] + 2010-08-21 Jan Nijtmans <nijtmans@users.sf.net> * generic/tk*Decls.h: (regenerated with modified genStubs.tcl) diff --git a/generic/tkText.c b/generic/tkText.c index ae0a49c..4c4ca20 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.100 2010/05/26 15:28:09 nijtmans Exp $ + * RCS: @(#) $Id: tkText.c,v 1.101 2010/08/27 00:33:12 hobbs Exp $ */ #include "default.h" @@ -4671,17 +4671,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 @@ -4792,7 +4792,7 @@ DumpLine( } else { while ((newOffset < endByte) && (newOffset < offset) && (newSegPtr != NULL)) { - newOffset += segPtr->size; + newOffset += currentSize; newSegPtr = newSegPtr->nextPtr; if (segPtr == newSegPtr) { break; |