summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2015-04-09 12:39:39 (GMT)
committerdgp <dgp@noemail.net>2015-04-09 12:39:39 (GMT)
commit428c1cd6d27bf09feb46c0cdb89414ac53830c06 (patch)
tree24e00ba54c7b8964f630041fe61d4dfc01937344
parent8844f5e740b77ae6a1115ede2e2540a3f682e03a (diff)
parent6a6a0cb6b407ccc2cd982d18a77d2a760bc11ad3 (diff)
downloadtk-428c1cd6d27bf09feb46c0cdb89414ac53830c06.zip
tk-428c1cd6d27bf09feb46c0cdb89414ac53830c06.tar.gz
tk-428c1cd6d27bf09feb46c0cdb89414ac53830c06.tar.bz2
[e4ed00a954] Fixed crash with display wordstart
FossilOrigin-Name: dd4b1845e5796fecca3cf216ea703f3456922e19
-rw-r--r--generic/tkTextIndex.c2
-rw-r--r--tests/textIndex.test5
2 files changed, 6 insertions, 1 deletions
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index 70f74fb..418b934 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -2327,7 +2327,7 @@ StartEnd(
int offset;
if (modifier == TKINDEX_DISPLAY) {
- TkTextIndexForwChars(NULL, indexPtr, 0, indexPtr,
+ TkTextIndexForwChars(textPtr, indexPtr, 0, indexPtr,
COUNT_DISPLAY_INDICES);
}
diff --git a/tests/textIndex.test b/tests/textIndex.test
index c949b1f..dead9c1 100644
--- a/tests/textIndex.test
+++ b/tests/textIndex.test
@@ -905,6 +905,11 @@ test textIndex-22.12 {text index wordstart, unicode} {
test textIndex-22.13 {text index wordstart, unicode} {
text_test_word wordstart "\uc700\uc700 abc" 8
} 3
+test textIndex-22.15 {text index display wordstart} {
+ catch {destroy .t}
+ text .t
+ .t index "1.0 display wordstart" ; # used to crash
+} 1.0
test textIndex-23.1 {text paragraph start} {
pack [text .t2]