From 90e5c98edaf99c01ec3f6c7dfd1174628b6fbaa8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 15 Apr 2019 21:34:04 +0200 Subject: Fix lilv_mkdir_p when used with forward slashes on Windows --- src/util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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; } } -- cgit v1.2.1