Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenfont/intern/blf_dir.c')
-rw-r--r--source/blender/blenfont/intern/blf_dir.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c
index 51d3849aa48..25235097505 100644
--- a/source/blender/blenfont/intern/blf_dir.c
+++ b/source/blender/blenfont/intern/blf_dir.c
@@ -47,6 +47,9 @@
#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)
@@ -137,9 +140,11 @@ char *blf_dir_search(const char *file)
}
if (!s) {
- /* check the current directory, why not ? */
- if (BLI_exists(file)) {
- s = BLI_strdup(file);
+ /* Assume file is either an abslute 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);
}
}