update: refactor and rename
This commit is contained in:
10
src/util.c
10
src/util.c
@ -18,16 +18,6 @@ bool eq(char *s1, char *s2) {
|
||||
return strcmp(s1, s2) == 0;
|
||||
}
|
||||
|
||||
bool joinhome(char *res, char *path) {
|
||||
char *homedir = getenv("HOME");
|
||||
|
||||
if (NULL == homedir)
|
||||
return false;
|
||||
|
||||
snprintf(res, PATH_MAX, "%s/%s", homedir, path);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool exists(char *path) {
|
||||
return access(path, F_OK) == 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user