From 2c20c70cd81e5ba51dc8e160fbd1c855eb97f065 Mon Sep 17 00:00:00 2001 From: Dmitriy Korovkin Date: Wed, 16 Sep 2020 16:02:10 -0400 Subject: [PATCH] Added platform specific path separators Add path separator symbol for Win32 (;) different from other platforms (:). The commit is supposed to fix the problem when drive letters on Windows are interpreted as separate directories. --- xsltproc/xsltproc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c index c434e966..abe7d12a 100644 --- a/xsltproc/xsltproc.c +++ b/xsltproc/xsltproc.c @@ -88,6 +88,11 @@ static int profile = 0; #define MAX_PARAMETERS 64 #define MAX_PATHS 64 +#ifdef _WIN32 +# define PATH_SEPARATOR ';' +#else +# define PATH_SEPARATOR ':' +#endif static int options = XSLT_PARSE_OPTIONS; static const char *params[MAX_PARAMETERS + 1]; @@ -103,6 +108,7 @@ static const char *writesubtree = NULL; /* * Entity loading control and customization. */ + static void parsePath(const xmlChar *path) { const xmlChar *cur; @@ -115,10 +121,10 @@ void parsePath(const xmlChar *path) { return; } cur = path; - while ((*cur == ' ') || (*cur == ':')) + while ((*cur == ' ') || (*cur == PATH_SEPARATOR)) cur++; path = cur; - while ((*cur != 0) && (*cur != ' ') && (*cur != ':')) + while ((*cur != 0) && (*cur != ' ') && (*cur != PATH_SEPARATOR)) cur++; if (cur != path) { paths[nbpaths] = xmlStrndup(path, cur - path);