Problem resolving relative URIs

Raised by Matthias Pigulla <mp@webfactory.de>

In a nutshell we had that bug on URI composition after some fixes in
the area of localhost empty shortcuts :

./testURI --base file:///some/where file

Without patch: file:/some/file
With patch: file:///some/file
This commit is contained in:
Daniel Veillard 2017-08-28 21:12:14 +02:00
parent f19385a589
commit 3daee3f159

10
uri.c
View File

@ -1961,8 +1961,9 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) {
res->scheme = xmlMemStrdup(bas->scheme);
if (bas->authority != NULL)
res->authority = xmlMemStrdup(bas->authority);
else if (bas->server != NULL) {
res->server = xmlMemStrdup(bas->server);
else if ((bas->server != NULL) || (bas->port == -1)) {
if (bas->server != NULL)
res->server = xmlMemStrdup(bas->server);
if (bas->user != NULL)
res->user = xmlMemStrdup(bas->user);
res->port = bas->port;
@ -2024,8 +2025,9 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) {
}
if (bas->authority != NULL)
res->authority = xmlMemStrdup(bas->authority);
else if (bas->server != NULL) {
res->server = xmlMemStrdup(bas->server);
else if ((bas->server != NULL) || (bas->port == -1)) {
if (bas->server != NULL)
res->server = xmlMemStrdup(bas->server);
if (bas->user != NULL)
res->user = xmlMemStrdup(bas->user);
res->port = bas->port;