diff options
author | Dmitriy Korovkin <Dmitriy.Korovkin@windriver.com> | 2020-09-16 16:02:10 -0400 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2020-09-20 17:01:51 +0200 |
commit | 2c20c70cd81e5ba51dc8e160fbd1c855eb97f065 (patch) | |
tree | b976262e6989b2ddedfc8246ee06de7634f95e0b | |
parent | f165525fe744e6fe3b377b480d6cc5f9c546d360 (diff) | |
download | libxslt-2c20c70cd81e5ba51dc8e160fbd1c855eb97f065.tar.gz |
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.
-rw-r--r-- | xsltproc/xsltproc.c | 10 |
1 files 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); |