Search for deskop files in correct directories

Signed-off-by: Felix Weilbach <felix.weilbach@t-online.de>
This commit is contained in:
Felix Weilbach 2021-05-01 13:04:19 +02:00
parent 7f2fd4a716
commit 66d3502769
4 changed files with 41 additions and 9 deletions

View file

@ -9,6 +9,7 @@
#include <stdio.h>
#include <assert.h>
#include <wayland-server-protocol.h>
#include <sys/stat.h>
#include "log.h"
#include "util.h"
@ -162,3 +163,8 @@ char *append_path_safe(const char *base_path, const char *append_path) {
snprintf(path, path_len, "%s/%s", base_path, append_path);
return path;
}
bool dir_exists(char *path) {
struct stat sb;
return stat(path, &sb) == 0 && S_ISDIR(sb.st_mode);
}