summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-04-15 21:34:04 +0200
committerDavid Robillard <d@drobilla.net>2019-04-15 23:03:12 +0200
commit90e5c98edaf99c01ec3f6c7dfd1174628b6fbaa8 (patch)
treecbae965be559a056f7c08ecf5d26ea68c80b60f3
parente688e49e365b9c62426c11fa92698c45d615cb02 (diff)
downloadlilv-90e5c98edaf99c01ec3f6c7dfd1174628b6fbaa8.tar.gz
lilv-90e5c98edaf99c01ec3f6c7dfd1174628b6fbaa8.tar.bz2
lilv-90e5c98edaf99c01ec3f6c7dfd1174628b6fbaa8.zip
Fix lilv_mkdir_p when used with forward slashes on Windows
-rw-r--r--src/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util.c b/src/util.c
index 1daf0ac..306a3a4 100644
--- a/src/util.c
+++ b/src/util.c
@@ -587,13 +587,14 @@ lilv_mkdir_p(const char* dir_path)
#endif
for (; i <= path_len; ++i) {
- if (path[i] == LILV_DIR_SEP[0] || path[i] == '\0') {
+ const char c = path[i];
+ if (c == LILV_DIR_SEP[0] || c == '/' || c == '\0') {
path[i] = '\0';
if (mkdir(path, 0755) && errno != EEXIST) {
free(path);
return errno;
}
- path[i] = LILV_DIR_SEP[0];
+ path[i] = c;
}
}