summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/util.c b/util.c
index e54e8ea..50f79ee 100644
--- a/util.c
+++ b/util.c
@@ -875,14 +875,18 @@ char const *get_userdata_dir()
char *read_bundled_file(char *name, uint32_t *sizeret)
{
- char *exe_dir = get_exe_dir();
- if (!exe_dir) {
+#ifdef DATA_PATH
+ char *data_dir = DATA_PATH;
+#else
+ char *data_dir = get_exe_dir();
+ if (!data_dir) {
if (sizeret) {
*sizeret = -1;
}
return NULL;
}
- char const *pieces[] = {exe_dir, PATH_SEP, name};
+#endif
+ char const *pieces[] = {data_dir, PATH_SEP, name};
char *path = alloc_concat_m(3, pieces);
FILE *f = fopen(path, "rb");
free(path);