summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/file.c b/file.c
index be044ca..5785805 100644
--- a/file.c
+++ b/file.c
@@ -64,16 +64,20 @@ file_free(struct file * file)
static bool
fill_metadata(struct file * f)
{
- char *ext;
+ char *ext, *data_dir;
char path[PATH_MAX];
struct stat sb;
size_t path_len;
+ data_dir = config_data_dir();
+ if (data_dir == NULL)
+ return false;
+
/* default mime */
f->mime = MIME__MAX;
/* check if it is a directory */
- path_len = url_build(path, PATH_MAX, DATA_DIR, f->path, f->name, NULL);
+ path_len = url_build(path, PATH_MAX, data_dir, f->path, f->name, NULL);
if (path_len == 0 || path_len >= PATH_MAX)
return false;