From e3833d52a2b4d3b18e74b92fb1ed76627b186751 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Tue, 8 Jun 2004 10:56:21 +0000 Subject: [project @ 2004-06-08 10:56:21 by bursa] Ignore whitespace at the start and end of URLs. svn path=/import/netsurf/; revision=935 --- utils/url.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'utils') diff --git a/utils/url.c b/utils/url.c index ac4f74013..3fb04170c 100644 --- a/utils/url.c +++ b/utils/url.c @@ -32,8 +32,10 @@ regex_t url_re, url_up_re, url_nice_re; void url_init(void) { /* regex from RFC 2396 */ - regcomp_wrapper(&url_re, "^(([a-zA-Z][-a-zA-Z0-9+.]*):)?(//([^/?#]*))?" - "([^?#]*)(\\?([^#]*))?(#(.*))?$", REG_EXTENDED); + regcomp_wrapper(&url_re, "^[[:space:]]*(([a-zA-Z][-a-zA-Z0-9+.]*):)?" + "(//([^/?#[:space:]]*))?([^?#[:space:]]*)" + "(\\?([^#[:space:]]*))?(#([^[:space:]]*))?" + "[[:space:]]*$", REG_EXTENDED); regcomp_wrapper(&url_up_re, "/(|[^/]|[.][^./]|[^./][.]|[^/][^/][^/]+)/[.][.](/|$)", REG_EXTENDED); -- cgit v1.2.3