summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-10-05 20:16:19 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-10-05 20:16:19 +0000
commit1203c4baf2b7dc5821fde7b87b7e6c374b740947 (patch)
tree9bd427e090ecef699c03637b9363e378abed7d66 /utils
parentd06fcf791a0de2666abeb407d3e57b60b0f4ee55 (diff)
downloadnetsurf-1203c4baf2b7dc5821fde7b87b7e6c374b740947.tar.gz
netsurf-1203c4baf2b7dc5821fde7b87b7e6c374b740947.tar.bz2
Ensure trailing whitespace is ignored.
svn path=/trunk/netsurf/; revision=12960
Diffstat (limited to 'utils')
-rw-r--r--utils/nsurl.c9
1 files changed, 9 insertions, 0 deletions
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;
}