mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-22 11:55:24 +00:00
Fixed bug with URL matching
Monotone-Parent: dac2c88734449dfb2523709ee6ad66d821245e35 Monotone-Revision: d6350865052ebcebfd9ec06ba135608c73b7c53f Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-06-30T19:09:57 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -250,7 +250,7 @@
|
||||
{
|
||||
currentRange = [currentRangePtr pointerValue];
|
||||
if (NSLocationInRange (testRange.location, *currentRange)
|
||||
|| NSLocationInRange (NSMaxRange (testRange), *currentRange))
|
||||
|| NSLocationInRange (currentRange->location, testRange))
|
||||
response = YES;
|
||||
}
|
||||
|
||||
|
||||
@@ -226,17 +226,13 @@ static NSMutableCharacterSet *urlStartChars = nil;
|
||||
matchRange.location = startLocation + 1;
|
||||
|
||||
currentUrlRange = [selfCopy _rangeOfURLInRange: matchRange];
|
||||
if ([ranges hasRangeIntersection: currentUrlRange])
|
||||
rest.location = NSMaxRange (currentUrlRange);
|
||||
else
|
||||
{
|
||||
if (currentUrlRange.length > matchLength)
|
||||
[newRanges addNonNSObject: ¤tUrlRange
|
||||
withSize: sizeof (NSRange)
|
||||
copy: YES];
|
||||
rest.location = NSMaxRange (currentUrlRange);
|
||||
}
|
||||
|
||||
if (![ranges hasRangeIntersection: currentUrlRange])
|
||||
if (currentUrlRange.length > matchLength)
|
||||
[newRanges addNonNSObject: ¤tUrlRange
|
||||
withSize: sizeof (NSRange)
|
||||
copy: YES];
|
||||
|
||||
rest.location = NSMaxRange (currentUrlRange);
|
||||
length = [selfCopy length];
|
||||
rest.length = length - rest.location;
|
||||
matchRange = [selfCopy rangeOfString: match
|
||||
@@ -258,7 +254,7 @@ static NSMutableCharacterSet *urlStartChars = nil;
|
||||
offset += ([newUrlText length] - [urlText length]);
|
||||
|
||||
// Add range for further substitutions
|
||||
currentUrlRange = NSMakeRange (currentUrlRange.location, [newUrlText length]);
|
||||
currentUrlRange = NSMakeRange (rangePtr->location, [newUrlText length]);
|
||||
[ranges addNonNSObject: ¤tUrlRange
|
||||
withSize: sizeof (NSRange)
|
||||
copy: YES];
|
||||
|
||||
Reference in New Issue
Block a user