creating .config dir if needed
Some checks failed
Codacy Scan / Codacy Security Scan (push) Failing after 1m57s
Build WHY2-chat / test-why2 (./out/why2-chat-client, ./configure.sh, ubuntu-latest, ./out/why2-chat-server) (push) Failing after 3m26s
Test Project / test-project (./configure.sh, gdb -ex "run" -ex "quit" --batch, ubuntu-latest, ./test) (push) Successful in 3m23s
Test WHY2-core / test-why2 (why2, ./configure.sh, gdb -ex "run" -ex "quit" --batch, ubuntu-latest, ./out/why2-core-test, valgrind --leak-check=full --show-leak-kinds=reachable --track-origins=yes -s) (push) Failing after 3m50s
Test WHY2-logger / test-why2 (why2-logger, ./configure.sh, gdb -ex "run" -ex "quit" --batch, ubuntu-latest, ./out/why2-logger-test, valgrind --leak-check=full --show-leak-kinds=reachable --track-origins=yes -s) (push) Failing after 4m34s

stupid gitea
This commit is contained in:
Václav Šmejkal 2025-01-09 16:19:03 +01:00
parent 0a7e9ecee7
commit e537f385e4
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -56,15 +56,23 @@ int removeDirectory(char *path)
void why2_directory(void) void why2_directory(void)
{ {
struct stat st; 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")); char *buffer = why2_replace(WHY2_CONFIG_DIR, "{HOME}", getenv("HOME"));
//CREATE USER CONFIG FOLDER //CREATE USER CONFIG FOLDER
if (stat(buffer_2, &st) == -1)
{
mkdir(buffer_2, 0700);
}
//CREATE WHY2 CONFIG FOLDER
if (stat(buffer, &st) == -1) if (stat(buffer, &st) == -1)
{ {
mkdir(buffer, 0700); mkdir(buffer, 0700);
} }
//DEALLOCATION //DEALLOCATION
why2_deallocate(buffer_2);
why2_deallocate(buffer); why2_deallocate(buffer);
} }