summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2017-01-07 15:14:44 (GMT)
committerfvogel <fvogelnew1@free.fr>2017-01-07 15:14:44 (GMT)
commit9f76636345a893b9bfe045dbf40de723fb29a011 (patch)
tree642b880a4e70b1ec3a170b1d9c46d66b00c5c9ea
parent09433140c6105863a449e366525f67083a5295aa (diff)
parentdaf2eae38a06d6471872c5ff1987af418eddbfaf (diff)
downloadtk-9f76636345a893b9bfe045dbf40de723fb29a011.zip
tk-9f76636345a893b9bfe045dbf40de723fb29a011.tar.gz
tk-9f76636345a893b9bfe045dbf40de723fb29a011.tar.bz2
Fix [28a4535fa2]: Off-by-1 error on text widget index on OS X
-rw-r--r--macosx/tkMacOSXFont.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index d3e0e41..b5ae1a3 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -870,7 +870,7 @@ TkpMeasureCharsInContext(
if (index <= start && !(flags & TK_WHOLE_WORDS)) {
index = CTTypesetterSuggestClusterBreak(typesetter, start, maxWidth);
}
- cs = (index < len || (flags & TK_WHOLE_WORDS)) ?
+ cs = (index <= len && (flags & TK_WHOLE_WORDS)) ?
whitespaceCharacterSet : lineendingCharacterSet;
while (index > start &&
[cs characterIsMember:[string characterAtIndex:(index - 1)]]) {