mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +03:00
Fix join with rel part of " ". Add a few tests.
This commit is contained in:
parent
af2d9e8906
commit
9ab851a5a9
@ -136,6 +136,12 @@ static const struct test_pairs join_tests[] = {
|
|||||||
{ "http://", "http:" },
|
{ "http://", "http:" },
|
||||||
{ "http:/", "http:" },
|
{ "http:/", "http:" },
|
||||||
{ "http:", "http:" },
|
{ "http:", "http:" },
|
||||||
|
{ " ", "http://a/b/c/d;p?q" },
|
||||||
|
{ " ", "http://a/b/c/d;p?q" },
|
||||||
|
{ "/", "http://a/" },
|
||||||
|
{ " / ", "http://a/" },
|
||||||
|
{ " ? ", "http://a/b/c/d;p?" },
|
||||||
|
{ " h ", "http://a/b/c/h" },
|
||||||
/* [1] Extra slash beyond rfc3986 5.4.1 example, since we're
|
/* [1] Extra slash beyond rfc3986 5.4.1 example, since we're
|
||||||
* testing normalisation in addition to joining */
|
* testing normalisation in addition to joining */
|
||||||
/* [2] Using the strict parsers option */
|
/* [2] Using the strict parsers option */
|
||||||
|
@ -264,6 +264,13 @@ static void nsurl__get_string_markers(const char * const url_s,
|
|||||||
marker.scheme_end = marker.authority = marker.colon_first = marker.at =
|
marker.scheme_end = marker.authority = marker.colon_first = marker.at =
|
||||||
marker.colon_last = marker.path = marker.start;
|
marker.colon_last = marker.path = marker.start;
|
||||||
|
|
||||||
|
if (*pos == '\0') {
|
||||||
|
/* Nothing but whitespace, early exit */
|
||||||
|
marker.query = marker.fragment = marker.end = marker.path;
|
||||||
|
*markers = marker;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get scheme */
|
/* Get scheme */
|
||||||
if (isalpha(*pos)) {
|
if (isalpha(*pos)) {
|
||||||
pos++;
|
pos++;
|
||||||
|
Loading…
Reference in New Issue
Block a user