1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

uri: Allow port without host

Don't set port to -1 when host is missing. Host can be empty according
to spec.

Fixes #71.
This commit is contained in:
Nick Wellnhofer 2022-11-14 21:05:32 +01:00
parent 76d6b0d768
commit f30adb54f5

2
uri.c
View File

@ -770,8 +770,6 @@ xmlParse3986HierPart(xmlURIPtr uri, const char **str)
cur += 2;
ret = xmlParse3986Authority(uri, &cur);
if (ret != 0) return(ret);
if (uri->server == NULL)
uri->port = -1;
ret = xmlParse3986PathAbEmpty(uri, &cur);
if (ret != 0) return(ret);
*str = cur;