Patch to be tolerant of whitespace in URLs

Philip Boulain prb at ecs.soton.ac.uk
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,
 "  http://www.google.co.uk/search?q=hello world  "
becomes
 "http://www.google.co.uk/search?q=hello%20world"

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.

LionsPhil

-------------- next part --------------
A non-text attachment was scrubbed...
Name: netsurf-url-whitespace3.patch
Type: text/x-patch
Size: 3086 bytes
Desc: not available
Url : http://vlists.pepperfish.net/pipermail/netsurf-dev-netsurf-browser.org/attachments/20080524/c71c9a91/netsurf-url-whitespace3.bin


More information about the netsurf-dev mailing list