diff options
-rw-r--r-- | source/blender/blenfont/intern/blf_dir.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c index 55c02b34f3d..f4a20faf109 100644 --- a/source/blender/blenfont/intern/blf_dir.c +++ b/source/blender/blenfont/intern/blf_dir.c @@ -47,9 +47,6 @@ #include "blf_internal.h" #include "blf_internal_types.h" -#include "BKE_global.h" -#include "BKE_main.h" - static ListBase global_font_dir = {NULL, NULL}; static DirBLF *blf_dir_find(const char *path) @@ -127,6 +124,8 @@ void BLF_dir_free(char **dirs, int count) char *blf_dir_search(const char *file) { + BLI_assert_msg(!BLI_path_is_rel(file), "Relative paths must always be expanded!"); + DirBLF *dir; char full_path[FILE_MAX]; char *s = NULL; @@ -140,11 +139,9 @@ char *blf_dir_search(const char *file) } if (!s) { - /* Assume file is either an absolute path, or a relative path to current directory. */ - BLI_strncpy(full_path, file, sizeof(full_path)); - BLI_path_abs(full_path, BKE_main_blendfile_path(G_MAIN)); - if (BLI_exists(full_path)) { - s = BLI_strdup(full_path); + /* This may be an absolute path which exists. */ + if (BLI_exists(file)) { + s = BLI_strdup(file); } } |