diff --git a/ChangeLog b/ChangeLog index 221c561d9..e03697b5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-04-02 Richard Frith-Macdonald + + * Source/NSAttributedString.m: Infinite loop fix by Fred Kiefer to + ([replaceCharactersInRange:withAttributedString:]) + 2000-03-29 Richard Frith-Macdonald * Source/NSUserDefaults.m: typo reported by karl@nfox.com fixed. diff --git a/Source/NSAttributedString.m b/Source/NSAttributedString.m index d2f5cfaa8..c5dee0dd6 100644 --- a/Source/NSAttributedString.m +++ b/Source/NSAttributedString.m @@ -621,17 +621,18 @@ static Class NSMutableAttributedString_concrete_class; NSRange ownRange; NSDictionary *attrDict; NSString *tmpStr; + unsigned loc; tmpStr = [attributedString string]; [self replaceCharactersInRange: aRange withString: tmpStr]; effectiveRange = NSMakeRange(0,0); clipRange = NSMakeRange(0,[tmpStr length]); - while (NSMaxRange(effectiveRange) < NSMaxRange(clipRange)) + while ((loc = NSMaxRange(effectiveRange)) < NSMaxRange(clipRange)) { - attrDict = [attributedString attributesAtIndex: effectiveRange.location + attrDict = [attributedString attributesAtIndex: loc effectiveRange: &effectiveRange]; - ownRange = NSIntersectionRange(clipRange,effectiveRange); + ownRange = NSIntersectionRange(clipRange, effectiveRange); ownRange.location += aRange.location; [self setAttributes: attrDict range: ownRange]; }