summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2004-06-08 10:56:21 +0000
committerJames Bursa <james@netsurf-browser.org>2004-06-08 10:56:21 +0000
commite3833d52a2b4d3b18e74b92fb1ed76627b186751 (patch)
treec4931921982bb8f3d3b17755707ec2fa46ab703c /utils
parente7d62fa174559dc14c7dbeb0c1e4828063c3e66f (diff)
downloadnetsurf-e3833d52a2b4d3b18e74b92fb1ed76627b186751.tar.gz
netsurf-e3833d52a2b4d3b18e74b92fb1ed76627b186751.tar.bz2
[project @ 2004-06-08 10:56:21 by bursa]
Ignore whitespace at the start and end of URLs. svn path=/import/netsurf/; revision=935
Diffstat (limited to 'utils')
-rw-r--r--utils/url.c6
1 files changed, 4 insertions, 2 deletions
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);