Update of /cvsroot/mahogany/M/src/util
In directory usw-pr-cvs1:/tmp/cvs-serv17543/src/util
Modified Files:
matchurl.cpp
Log Message:
assume that wrapped URLs always start at the beginning of the line, otherwise we get
too many false positives
Index: matchurl.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/util/matchurl.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -b -u -2 -r1.5 -r1.6
--- matchurl.cpp 26 Apr 2002 18:01:37 -0000 1.5
+++ matchurl.cpp 26 Apr 2002 23:10:05 -0000 1.6
@@ -468,5 +468,5 @@
// URLs are frequently so long that they're spread across multiple
- // lines, try to see if this might be the case here
+ // lines, so try to see if this might be the case here
if ( p[0] != '\r' || p[1] != '\n' || !IsURLChar(p[2]) )
{
@@ -475,6 +475,22 @@
}
- // continue on the next line and no need to test the first
- // character
+ // it might be a wrapped URL but it might be not: it seems like we
+ // get way too many false positives if we suppose that it's already
+ // the case... so restrict the wrapped URLs detection to the case
+ // when they occur at the beginning of the line, possibly after some
+ // white space as this is how people usually format them
+ const char *q = start;
+ while ( q >= text && *q != '\n' )
+ {
+ if ( !isspace(*q--) )
+ break;
+ }
+
+ if ( q >= text && *q != '\n' )
+ break;
+
+ // it did occur at the start, suppose the URL is wrapped ans so
+ // continue on the next line (no need to test the first character,
+ // it had been already done above)
p += 3;
}
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates