adium 5584:1031c3d6b70e: When scanning for links, the current lo...

commits at adium.im commits at adium.im
Mon Jun 24 02:58:17 UTC 2013


details:	http://hg.adium.im/adium/rev/1031c3d6b70e
revision:	5584:1031c3d6b70e
branch:		adium-1.6
author:		Frank Dowsett <wixardy at adium.im>
date:		Sat Jun 22 00:40:15 2013 -0400

When scanning for links, the current location wasn't being updated before checking/creating a link leading to the next pass starting from before the last URL ended. This fixes #16217 and #16413.
(transplanted from ac2d267c77af5689cd1ab422c18258c52727afac)

diffs (22 lines):

diff -r 404f347badab -r 1031c3d6b70e Frameworks/AutoHyperlinks Framework/Source/AHHyperlinkScanner.m
--- a/Frameworks/AutoHyperlinks Framework/Source/AHHyperlinkScanner.m	Mon Jun 17 23:52:18 2013 +0200
+++ b/Frameworks/AutoHyperlinks Framework/Source/AHHyperlinkScanner.m	Sat Jun 22 00:40:15 2013 -0400
@@ -34,7 +34,7 @@
 #define ENC_INDEX_KEY @"encIndex"
 #define ENC_CHAR_KEY @"encChar"
 
-#define MIN_LINK_LENGTH 0
+#define MIN_LINK_LENGTH 4
 
 @interface AHHyperlinkScanner (PRIVATE)
 - (AHMarkedHyperlink *)nextURIFromLocation:(unsigned long *)_scanLocation;
@@ -288,6 +288,9 @@
                 }else break;
             }
             
+            // Update the scan location
+            m_scanLocation = scannedRange.location;
+            
             // if we have a valid URL then save the scanned string, and make a SHMarkedHyperlink out of it.
             // this way, we can preserve things like the matched string (to be converted to a NSURL),
             // parent string, its validation status (valid, file, degenerate, etc), and its range in the parent string




More information about the commits mailing list