mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 06:55:44 +00:00
[LIBXML2] Update to version 2.9.9. CORE-15854
This commit is contained in:
parent
743951eccf
commit
1fe58c4058
22 changed files with 291 additions and 461 deletions
49
sdk/lib/3rdparty/libxml2/uri.c
vendored
49
sdk/lib/3rdparty/libxml2/uri.c
vendored
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue