Update of /cvsroot/mahogany/M/src/util
In directory usw-pr-cvs1:/tmp/cvs-serv682/src/util
Modified Files:
matchurl.cpp
Log Message:
added a length check to URL wrapping logic
Index: matchurl.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/util/matchurl.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -b -u -2 -r1.21 -r1.22
--- matchurl.cpp 6 Nov 2002 00:27:53 -0000 1.21
+++ matchurl.cpp 8 Nov 2002 00:14:18 -0000 1.22
@@ -658,10 +658,21 @@
for ( ;; )
{
+ size_t lenURL = 0;
while ( IsURLChar(*p) )
+ {
+ lenURL++;
p++;
+ }
// URLs are frequently so long that they're spread across multiple
// lines, so try to see if this might be the case here
- if ( p[0] != '\r' || p[1] != '\n' || !IsURLChar(p[2]) )
+ //
+ // first of all: is it at the end of line and can it be continued on
+ // the next one? also check if it's really long enough to be wrapped:
+ // the short URLs normally shouldn't be wrapped
+ static const size_t URL_WRAP_LEN = 50; // min len of wrapped URL
+ if ( p[0] != '\r' || p[1] != '\n'
+ || lenURL < URL_WRAP_LEN
+ || !IsURLChar(p[2]) )
{
// it isn't
-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates