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:
authorCampbell Barton <ideasman42@gmail.com>2021-08-28 10:21:50 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-08-28 12:21:54 +0300
commit0b6be261261151032b6ebfe80320ff198b5df200 (patch)
tree1adea491694bb9ef5af7d2336c42a6de64f0ff67 /source/blender/blenfont
parenteae4e225183991109a014b88775744187b8a77e3 (diff)
BLF: remove checks for blend file relative paths
This was added in b24712a9ca6fa807660a02d6988269748daecdbf but is no longer needed as of efc129bc827558e55cf4619b8e2ca502342338f3. Further, this wasn't reliable as it could fail on linked library data which has a different base directory. Assert when blend file relative paths are passed to BLF (matching imbuf file loading).
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/intern/blf_dir.c13
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);
}
}