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:
authorSybren A. Stüvel <sybren@blender.org>2021-09-28 12:05:45 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-09-28 12:05:45 +0300
commitb91946780cd4fecd4dacebd1cd5b785a89773f0f (patch)
tree650122bb844d5920d233c1c4d910db70fe2abe2b /source/blender/blenlib/intern
parent741fa8180c4fbe98f3cc8b3eee239b03e26309f4 (diff)
Path util: BLI_path_contains() case-insensitive on Windows
Make `BLI_path_contains()` case-insensitive on Windows. This behaviour is dependent on the platform Blender is running on, like the rest of BLI_path, and not on the style of paths (Windows-style paths will be treated case-sensitively when Blender is running on Linux/macOS).
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r--source/blender/blenlib/intern/path_util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 4fc59e6cffd..4405f25bf2a 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -1951,6 +1951,11 @@ bool BLI_path_contains(const char *container_path, const char *containee_path)
BLI_path_normalize(NULL, container_native);
BLI_path_normalize(NULL, containee_native);
+#ifdef WIN32
+ BLI_str_tolower_ascii(container_native, PATH_MAX);
+ BLI_str_tolower_ascii(containee_native, PATH_MAX);
+#endif
+
if (STREQ(container_native, containee_native)) {
/* The paths are equal, they contain each other. */
return true;