From e24599fd4c50c3f40fa15da811a19aea3f593fe6 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Thu, 2 May 2024 14:05:31 +0200 Subject: [PATCH 1/2] Fixed issue with mkdir on Windows Ticket: None Changelog: None Signed-off-by: Lars Erik Wik --- lib/files.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/files.c b/lib/files.c index 863b27aa4..4a4a39222 100644 --- a/lib/files.c +++ b/lib/files.c @@ -9,6 +9,10 @@ #include #include +#ifdef _WIN32 +#include +#endif // _WIN32 + #include "definitions.h" #include "logger.h" #include "string_lib.h" @@ -141,7 +145,13 @@ bool LCH_FileCreateParentDirectories(const char *const filename) { const size_t num_dirs = LCH_ListLength(dirs); for (size_t i = num_dirs; i > 0; i--) { char *const dir = (char *)LCH_ListGet(dirs, i - 1); - if (mkdir(dir, (mode_t)0700) == -1) { + int ret = +#ifdef _WIN32 + _mkdir(dir); +#else // _WIN32 + mkdir(dir, (mode_t)0700); +#endif // _WIN32 + if (ret == -1) { LCH_LOG_ERROR("Failed to create parent directory '%s' for file '%s': %s", dir, filename, strerror(errno)); LCH_ListDestroy(dirs); From 52c102c4948f8512524c93b23f388e14a1e81a8b Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Thu, 2 May 2024 14:06:11 +0200 Subject: [PATCH 2/2] Bumped version to 0.1.12 Ticket: None Changelog: None Signed-off-by: Lars Erik Wik --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 35270ccca..50e8cd93f 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.63]) -AC_INIT([leech], [0.1.11], [https://github.com/larsewi/leech/issues], [leech], +AC_INIT([leech], [0.1.12], [https://github.com/larsewi/leech/issues], [leech], [https://github.com/larsewi/leech]) AC_CONFIG_SRCDIR([lib/leech.h])