Update of /cvsroot/mahogany/M/src/util
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32658/src/util

Modified Files:
        matchurl.cpp 
Log Message:
relaxed URL check added by last commit slightly

Index: matchurl.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/util/matchurl.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -b -u -2 -r1.32 -r1.33
--- matchurl.cpp        14 Jul 2004 18:19:11 -0000      1.32
+++ matchurl.cpp        15 Jul 2004 21:52:02 -0000      1.33
@@ -765,18 +765,24 @@
    // "www.xyz.fr" are probably the shortest ones we can have, hence 10) which
    // at least avoids matching the bare '@'s
-   //
-   // also check that we have at least one dot in the domain part for the mail
-   // addresses and two dots for the other URLs, otherwise it probably isn't an
-   // address/URL neither
    bool good = (p - start) >= 10;
 
    if ( good )
    {
+      // also check that we have at least one dot in the domain part for the
+      // mail addresses
       const char *
          pDot = (char *)memchr(text + pos + 1, '.', p - text - pos - 1);
       if ( !pDot )
+      {
          good = false;
+      }
       else if ( !isMail )
-         good = memchr(pDot + 1, '.', p - pDot - 1) != NULL;
+      {
+         // and has either two dots or at least a slash the other URLs,
+         // otherwise it probably isn't an address/URL neither (stuff like
+         // "... using ftp.If you ... " shouldn't be recognized as an URL)
+         good = memchr(pDot + 1, '.', p - pDot - 1) != NULL ||
+                  memchr(pDot + 1, '/', p - pDot - 1) != NULL;
+      }
    }
 



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to