summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-10-31 14:21:48 (GMT)
committervincentdarley <vincentdarley>2003-10-31 14:21:48 (GMT)
commit3e4b9ddf078d687679e15a6b5fc0c024884a1d9a (patch)
tree06535c94176e831d89c2632b0f0a94723bb55f9b /generic
parent65d781267ff97522f0dbde3718a2f79f6cafeb14 (diff)
downloadtk-3e4b9ddf078d687679e15a6b5fc0c024884a1d9a.zip
tk-3e4b9ddf078d687679e15a6b5fc0c024884a1d9a.tar.gz
tk-3e4b9ddf078d687679e15a6b5fc0c024884a1d9a.tar.bz2
text widget bug fix
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTextDisp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 701fe96..7a97aa7 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.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: tkTextDisp.c,v 1.18 2003/10/31 09:02:10 vincentdarley Exp $
+ * RCS: @(#) $Id: tkTextDisp.c,v 1.19 2003/10/31 14:21:49 vincentdarley Exp $
*/
#include "tkPort.h"
@@ -5636,7 +5636,16 @@ DlineIndexOfX(textPtr, dlPtr, x, indexPtr)
*indexPtr = dlPtr->index;
x = x - dInfoPtr->x + dInfoPtr->curXPixelOffset;
- for (chunkPtr = dlPtr->chunkPtr; x >= (chunkPtr->x + chunkPtr->width);
+ chunkPtr = dlPtr->chunkPtr;
+
+ if (chunkPtr == NULL) {
+ /*
+ * This may occur if everything is elided
+ */
+ return;
+ }
+
+ for (; x >= (chunkPtr->x + chunkPtr->width);
indexPtr->byteIndex += chunkPtr->numBytes,
chunkPtr = chunkPtr->nextPtr) {
if (chunkPtr->nextPtr == NULL) {