[libxslt] Added platform specific path separators
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxslt] Added platform specific path separators
- Date: Sun, 20 Sep 2020 15:15:30 +0000 (UTC)
commit 2c20c70cd81e5ba51dc8e160fbd1c855eb97f065
Author: Dmitriy Korovkin <Dmitriy Korovkin windriver com>
Date: Wed Sep 16 16:02:10 2020 -0400
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]