From 1895007219c2650c452aeed878ccb5bf66ae8df1 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 23 Jul 2003 21:46:39 +0000 Subject: applying a patch based on #117377 for --path option. Daniel * xsltproc/xsltproc.c: applying a patch based on #117377 for --path option. Daniel --- xsltproc/xsltproc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'xsltproc') 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); -- cgit v1.2.3