diff --git a/ChangeLog b/ChangeLog index 7c7d968a3..6d5bd5836 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,18 @@ +2015-01-31 Fred Kiefer + + * Source/GSTextStorage.m + * Source/NSSpellChecker.m + Two small cleanups. + Patch by Marat Ibadinov + * Source/NSLayoutManager.m + Changed == to >= to fix a crash when layout_char is beyond the + length of the string. + Patch by Paul Landers . + 2015-01-23 Fred Kiefer * Source/NSBitmapImageRep.m (-copyWithZone): Changed the call from - -copyWithZone: to -mutableCopyWithZone:. + -copyWithZone: to -mutableCopyWithZone:. * Tests/gui/NSBitmapImageRep/testcopy.m: Test for this change Patch by Josh Freeman . diff --git a/Source/GSTextStorage.m b/Source/GSTextStorage.m index aab931456..aa57b5c01 100644 --- a/Source/GSTextStorage.m +++ b/Source/GSTextStorage.m @@ -681,7 +681,7 @@ _attributesAtIndexEffectiveRange( if (range.length == 0) { - NSWarnMLog(@"Attempt to set attribute for zero-length range", 0); + NSWarnMLog(@"Attempt to set attribute for zero-length range"); return; } if (attributes == nil) diff --git a/Source/NSLayoutManager.m b/Source/NSLayoutManager.m index 67223736d..82707f8f1 100644 --- a/Source/NSLayoutManager.m +++ b/Source/NSLayoutManager.m @@ -2637,7 +2637,7 @@ this file describes this. if (!layout_char) new_last_glyph = 0; - else if (layout_char == [_textStorage length]) + else if (layout_char >= [_textStorage length]) new_last_glyph = [self numberOfGlyphs]; else new_last_glyph = [self glyphRangeForCharacterRange: NSMakeRange(layout_char, 1) diff --git a/Source/NSSpellChecker.m b/Source/NSSpellChecker.m index 979dbb403..5840fd4f4 100644 --- a/Source/NSSpellChecker.m +++ b/Source/NSSpellChecker.m @@ -62,7 +62,7 @@ #import "GNUstepGUI/GSServicesManager.h" // prototype for function to create name for server -NSString *GSSpellServerName(NSString *checkerDictionary, NSString *language); +extern NSString *GSSpellServerName(NSString *checkerDictionary, NSString *language); // These are methods which we only want the NSSpellChecker to call. // The protocol is defined here so that the outside world does not