From 1203c4baf2b7dc5821fde7b87b7e6c374b740947 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 5 Oct 2011 20:16:19 +0000 Subject: Ensure trailing whitespace is ignored. svn path=/trunk/netsurf/; revision=12960 --- utils/nsurl.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'utils') diff --git a/utils/nsurl.c b/utils/nsurl.c index dcc878edb..9faf311d7 100644 --- a/utils/nsurl.c +++ b/utils/nsurl.c @@ -367,6 +367,15 @@ static void nsurl__get_string_markers(const char const *url_s, pos--; marker.end = pos + 1 - url_s; + /* Ensure last url section doesn't pass end */ + if (marker.fragment > marker.end) marker.fragment = marker.end; + if (marker.query > marker.end) marker.query = marker.end; + if (marker.path > marker.end) marker.path = marker.end; + if (marker.colon_last > marker.end) marker.colon_last = marker.end; + if (marker.at > marker.end) marker.at = marker.end; + if (marker.colon_last > marker.end) marker.colon_last = marker.end; + if (marker.fragment > marker.end) marker.fragment = marker.end; + /* Got all the URL components pegged out now */ *markers = marker; } -- cgit v1.2.3