[LIBXML2] Update to version 2.9.9. CORE-15854

This commit is contained in:
Thomas Faber 2019-03-12 10:19:35 +01:00
parent 743951eccf
commit 1fe58c4058
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
22 changed files with 291 additions and 461 deletions

View file

@ -2236,25 +2236,8 @@ xmlBuildRelativeURI (const xmlChar * URI, const xmlChar * base)
* First we take care of the special case where either of the
* two path components may be missing (bug 316224)
*/
if (bas->path == NULL) {
if (ref->path != NULL) {
uptr = (xmlChar *) ref->path;
if (*uptr == '/')
uptr++;
/* exception characters from xmlSaveUri */
val = xmlURIEscapeStr(uptr, BAD_CAST "/;&=+$,");
}
goto done;
}
bptr = (xmlChar *)bas->path;
if (ref->path == NULL) {
for (ix = 0; bptr[ix] != 0; ix++) {
if (bptr[ix] == '/')
nbslash++;
}
uptr = NULL;
len = 1; /* this is for a string terminator only */
} else {
{
xmlChar *rptr = (xmlChar *) ref->path;
int pos = 0;
@ -2280,30 +2263,28 @@ xmlBuildRelativeURI (const xmlChar * URI, const xmlChar * base)
* beginning of the "unique" suffix of URI
*/
ix = pos;
if ((rptr[ix] == '/') && (ix > 0))
ix--;
else if ((rptr[ix] == 0) && (ix > 1) && (rptr[ix - 1] == '/'))
ix -= 2;
for (; ix > 0; ix--) {
if (rptr[ix] == '/')
if (rptr[ix - 1] == '/')
break;
}
if (ix == 0) {
uptr = (xmlChar *)rptr;
} else {
ix++;
uptr = (xmlChar *)&rptr[ix];
}
uptr = (xmlChar *)&rptr[ix];
/*
* In base, count the number of '/' from the differing point
*/
if (bptr[pos] != rptr[pos]) {/* check for trivial URI == base */
for (; bptr[ix] != 0; ix++) {
if (bptr[ix] == '/')
nbslash++;
}
for (; bptr[ix] != 0; ix++) {
if (bptr[ix] == '/')
nbslash++;
}
/*
* e.g: URI="foo/" base="foo/bar" -> "./"
*/
if (nbslash == 0 && !uptr[0]) {
val = xmlStrdup(BAD_CAST "./");
goto done;
}
len = xmlStrlen (uptr) + 1;
}