Patch to be tolerant of whitespace in URLs

Philip Boulain prb at
Sat May 24 12:33:23 BST 2008

The attached patch makes url_normalize take care of whitespace in a
fairly useful way, consistent with other browsers:

 - Leading and trailing whitespace is trimmed
 - Internal whitespace is urlescaped

For example,
 " world  "

Explicit trailing whitespace, e.g. "...hello world%20", is left alone.

The upshot is that if you sloppily copy-paste a URL from IRC or whatnot
into the address bar, NetSurf no longer silently ignores you if you
caught some adjacent whitespace.

Apparently there are some badly-written websites out there in the wild
(who knew?) which don't escape their mid-URL whitespace properly,
either, so this should improve the chances of NetSurf working with them.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: netsurf-url-whitespace3.patch
Type: text/x-patch
Size: 3086 bytes
Desc: not available
Url :

More information about the netsurf-dev mailing list