applying a patch based on #117377 for --path option. Daniel
authorDaniel Veillard <veillard@src.gnome.org>
Wed, 23 Jul 2003 21:46:39 +0000 (21:46 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Wed, 23 Jul 2003 21:46:39 +0000 (21:46 +0000)
* xsltproc/xsltproc.c: applying a patch based on #117377
  for --path option.
Daniel

ChangeLog
xsltproc/xsltproc.c

index 4e23b79..72cb1c1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jul 23 21:57:39 IST 2003 Daniel Veillard <daniel@veillard.com>
+
+       * xsltproc/xsltproc.c: applying a patch based on #117377
+         for --path option.
+
 Mon Jul 21 20:28:11 IST 2003 Daniel Veillard <daniel@veillard.com>
 
        * libxslt/transform.c: allow strip-space to support full namespaces
index cf1bb4f..ac4ead3 100644 (file)
@@ -160,6 +160,14 @@ xsltprocExternalEntityLoader(const char *URL, const char *ID,
     warningSAXFunc warning = NULL;
 
     int i;
+    const char *lastsegment = URL;
+    const char *iter = URL;
+
+    while (*iter != 0) {
+        if (*iter == '/')
+           lastsegment = iter + 1;
+       iter++;
+    }
 
     if ((ctxt != NULL) && (ctxt->sax != NULL)) {
        warning = ctxt->sax->warning;
@@ -179,7 +187,7 @@ xsltprocExternalEntityLoader(const char *URL, const char *ID,
 
        newURL = xmlStrdup((const xmlChar *) paths[i]);
        newURL = xmlStrcat(newURL, (const xmlChar *) "/");
-       newURL = xmlStrcat(newURL, (const xmlChar *) URL);
+       newURL = xmlStrcat(newURL, (const xmlChar *) lastsegment);
        if (newURL != NULL) {
            ret = defaultEntityLoader((const char *)newURL, ID, ctxt);
            xmlFree(newURL);