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 <campbell@blender.org>2022-01-28 07:02:13 +0300
committerCampbell Barton <campbell@blender.org>2022-01-28 07:05:21 +0300
commit9523b1478ebc447fc6bd7937eb2d80d9c87bda42 (patch)
tree46a8b776000ecd283ab9dfe718427dfc1d8fbfc9
parentebd0e7608860e0a7a1b0fbe563a4329919f78799 (diff)
BLI_path: assert passing relative paths to BLI_path_cmp_normalized
Assert when "//" prefixed relative paths are passed to BLI_path_cmp_normalized as this can't be expanded and it's possible the paths come from different blend files.
-rw-r--r--source/blender/blenlib/intern/path_util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 65e8c151e8d..f39797c980c 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -1832,6 +1832,8 @@ void BLI_path_slash_native(char *path)
int BLI_path_cmp_normalized(const char *p1, const char *p2)
{
+ BLI_assert_msg(!BLI_path_is_rel(p1) && !BLI_path_is_rel(p2), "Paths arguments must be absolute");
+
/* Normalize the paths so we can compare them. */
char norm_p1[FILE_MAX];
char norm_p2[FILE_MAX];