aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam M. Brack <wbrack@src.gnome.org>2004-07-26 00:20:13 +0000
committerWilliam M. Brack <wbrack@src.gnome.org>2004-07-26 00:20:13 +0000
commitb85c9205f94921a61a08ddedbb3605fd7ef69b12 (patch)
treec3bdf04c77e62b1adeaae1e7c53e2ab8ea91f449
parentcd3628b7dd46b39d94c78fd4989cb5af976f86de (diff)
downloadandroid_external_libxml2-b85c9205f94921a61a08ddedbb3605fd7ef69b12.tar.gz
android_external_libxml2-b85c9205f94921a61a08ddedbb3605fd7ef69b12.tar.bz2
android_external_libxml2-b85c9205f94921a61a08ddedbb3605fd7ef69b12.zip
added some code to check, when an include is done, whether the requested
* xinclude.c: added some code to check, when an include is done, whether the requested URL gets mapped to some other location (e.g. with a catalog entry) and, if so, take care of the xml:base properly (bug 146988)
-rw-r--r--ChangeLog7
-rw-r--r--xinclude.c10
2 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 29c20ec9..b5d72550 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sun Jul 25 17:18:39 PDT 2004 William Brack <wbrack@mmm.com.hk>
+
+ * xinclude.c: added some code to check, when an include is
+ done, whether the requested URL gets mapped to some other
+ location (e.g. with a catalog entry) and, if so, take care
+ of the xml:base properly (bug 146988)
+
Sun Jul 25 14:02:24 PDT 2004 William Brack <wbrack@mmm.com.hk>
* error.c: fixed to assure user data param is set correctly
diff --git a/xinclude.c b/xinclude.c
index 196f4a9d..aa14b2c6 100644
--- a/xinclude.c
+++ b/xinclude.c
@@ -1459,6 +1459,16 @@ xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) {
return(-1);
}
ctxt->incTab[nr]->doc = doc;
+ /*
+ * It's possible that the requested URL has been mapped to a
+ * completely different location (e.g. through a catalog entry).
+ * To check for this, we compare the URL with that of the doc
+ * and change it if they disagree (bug 146988).
+ */
+ if (!xmlStrEqual(URL, doc->URL)) {
+ xmlFree(URL);
+ URL = xmlStrdup(doc->URL);
+ }
for (i = nr + 1; i < ctxt->incNr; i++) {
if (xmlStrEqual(URL, ctxt->incTab[i]->URI)) {
ctxt->incTab[nr]->count++;