From e537f385e4db6909cd4ff4ecb213fb05fadfff5e Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Thu, 9 Jan 2025 16:19:03 +0100 Subject: [PATCH] creating .config dir if needed stupid gitea --- src/core/lib/utils/misc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/lib/utils/misc.c b/src/core/lib/utils/misc.c index e9aca75..425277d 100644 --- a/src/core/lib/utils/misc.c +++ b/src/core/lib/utils/misc.c @@ -56,15 +56,23 @@ int removeDirectory(char *path) void why2_directory(void) { struct stat st; + char *buffer_2 = why2_replace(WHY2_USER_CONFIG_DIR, "{HOME}", getenv("HOME")); char *buffer = why2_replace(WHY2_CONFIG_DIR, "{HOME}", getenv("HOME")); //CREATE USER CONFIG FOLDER + if (stat(buffer_2, &st) == -1) + { + mkdir(buffer_2, 0700); + } + + //CREATE WHY2 CONFIG FOLDER if (stat(buffer, &st) == -1) { mkdir(buffer, 0700); } //DEALLOCATION + why2_deallocate(buffer_2); why2_deallocate(buffer); }