diff options
Diffstat (limited to 'uri.c')
-rw-r--r-- | uri.c | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -1078,11 +1078,13 @@ xmlURIEscape(const xmlChar * str) static int xmlParseURIFragment(xmlURIPtr uri, const char **str) { - const char *cur = *str; - + const char *cur; + if (str == NULL) return (-1); + cur = *str; + while (IS_URIC(cur) || IS_UNWISE(cur)) NEXT(cur); if (uri != NULL) { @@ -1111,11 +1113,13 @@ xmlParseURIFragment(xmlURIPtr uri, const char **str) static int xmlParseURIQuery(xmlURIPtr uri, const char **str) { - const char *cur = *str; + const char *cur; if (str == NULL) return (-1); + cur = *str; + while ((IS_URIC(cur)) || ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur)))) NEXT(cur); @@ -2419,7 +2423,13 @@ path_processing: xmlFreeURI(uri); return(NULL); } - ret = xmlSaveUri(uri); + + if (uri->scheme == NULL) { + ret = xmlStrdup((const xmlChar *) path); + } else { + ret = xmlSaveUri(uri); + } + xmlFreeURI(uri); #else ret = xmlStrdup((const xmlChar *) path); |