Commit bd20df79 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

- uri.c: Wayne Davison's patch fixing xmlBuildURI()

- Makefile.mingw: Wayne Davison's update adding hash.c
Daniel
parent c4f4f0b7
Sun Oct 29 18:51:46 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* 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 <Daniel.Veillard@w3.org>
* xpath.c: fixed the root evaluation problems
......
......@@ -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
......
......@@ -34,6 +34,7 @@ LIBSRCS=HTMLparser.c \
xmlmemory.c \
xpath.c \
xpointer.c \
hash.c \
uri.c
LIBOBJS=$(LIBSRCS:.c=.o)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment