feat(utilities): added cut_path and combine_path to modify paths for storage and later usage in the file system

This commit is contained in:
lisk77 2025-08-22 23:54:29 +02:00
parent 25480fc92f
commit 483cb08a83
2 changed files with 40 additions and 0 deletions

View file

@ -73,6 +73,11 @@ static char* join_path(const char* a, const char* b) {
return s;
}
// A function that returns the system path of the where the closest merk
// directory to the current working directory is located up in direction to
// the filesystem root
// Mutates relative in place to get the correct amount of ../ in relation to
// the directory which the software was called in
char* find_root(char* relative) {
char* current_dir = calloc(PATH_MAX, sizeof(char));
if (!current_dir) {