diff --git a/ChangeLog b/ChangeLog index 347f959d..88a5920c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Oct 29 18:51:46 CET 2000 Daniel Veillard + + * uri.c: Wayne Davison's patch fixing xmlBuildURI() + * Makefile.mingw: Wayne Davison's update adding hash.c + Sun Oct 29 18:38:12 CET 2000 Daniel Veillard * xpath.c: fixed the root evaluation problems diff --git a/uri.c b/uri.c index 79c78e2a..a6d9f006 100644 --- a/uri.c +++ b/uri.c @@ -1433,7 +1433,7 @@ xmlNormalizeURIPath(char *path) { xmlChar * xmlBuildURI(const xmlChar *URI, const xmlChar *base) { xmlChar *val = NULL; - int ret, ret2, len, index, cur, out; + int ret, len, index, cur, out; xmlURIPtr ref = NULL; xmlURIPtr bas = NULL; xmlURIPtr res = NULL; @@ -1449,25 +1449,31 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) { if (URI == NULL) ret = -1; else { - ref = xmlCreateURI(); - if (ref == NULL) - goto done; - if (*URI) + if (*URI) { + ref = xmlCreateURI(); + if (ref == NULL) + goto done; ret = xmlParseURIReference(ref, (const char *) URI); + } else - ret = -1; + ret = 0; } + if (ret != 0) + goto done; if (base == NULL) - ret2 = -1; + ret = -1; else { bas = xmlCreateURI(); if (bas == NULL) goto done; - ret2 = xmlParseURIReference(bas, (const char *) base); + ret = xmlParseURIReference(bas, (const char *) base); } - if ((ret != 0) && (ret2 != 0)) - goto done; if (ret != 0) { + if (ref) + val = xmlSaveUri(ref); + goto done; + } + if (ref == NULL) { /* * the base fragment must be ignored */ @@ -1478,11 +1484,6 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) { val = xmlSaveUri(bas); goto done; } - if (ret2 != 0) { - val = xmlSaveUri(ref); - goto done; - } - /* * 2) If the path component is empty and the scheme, authority, and diff --git a/win32/Makefile.mingw b/win32/Makefile.mingw index 162fd5e6..3e518ef7 100644 --- a/win32/Makefile.mingw +++ b/win32/Makefile.mingw @@ -34,6 +34,7 @@ LIBSRCS=HTMLparser.c \ xmlmemory.c \ xpath.c \ xpointer.c \ + hash.c \ uri.c LIBOBJS=$(LIBSRCS:.c=.o)