summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2003-07-23 21:46:39 +0000
committerDaniel Veillard <veillard@src.gnome.org>2003-07-23 21:46:39 +0000
commit1895007219c2650c452aeed878ccb5bf66ae8df1 (patch)
treee9b36373f0a3f5a2b0d481b8d4003963f35d92df
parentdf6397cd505f33a6244d76600257f977468e8d9b (diff)
downloadlibxslt-1895007219c2650c452aeed878ccb5bf66ae8df1.tar.gz
libxslt-1895007219c2650c452aeed878ccb5bf66ae8df1.tar.bz2
libxslt-1895007219c2650c452aeed878ccb5bf66ae8df1.zip
applying a patch based on #117377 for --path option. Daniel
* xsltproc/xsltproc.c: applying a patch based on #117377 for --path option. Daniel
-rw-r--r--ChangeLog5
-rw-r--r--xsltproc/xsltproc.c10
2 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4e23b79a..72cb1c12 100644
--- 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
diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c
index cf1bb4f8..ac4ead3a 100644
--- a/xsltproc/xsltproc.c
+++ b/xsltproc/xsltproc.c
@@ -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);