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:
parent
25480fc92f
commit
483cb08a83
2 changed files with 40 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue