[Bf-blender-cvs] [3d677d91900] master: Fix OSX duplicate path in Python's sys.path
Campbell Barton
noreply at git.blender.org
Fri Aug 11 00:42:51 CEST 2017
Commit: 3d677d9190088aa7fe084767a39158a376cd5d63
Author: Campbell Barton
Date: Fri Aug 11 08:42:27 2017 +1000
Branches: master
https://developer.blender.org/rB3d677d9190088aa7fe084767a39158a376cd5d63
Fix OSX duplicate path in Python's sys.path
The '..' in the path caused simple comparisons to fail.
D2780 by @akitula
===================================================================
M source/blender/blenkernel/intern/appdir.c
===================================================================
diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c
index 43fd47981b1..48012bd9e90 100644
--- a/source/blender/blenkernel/intern/appdir.c
+++ b/source/blender/blenkernel/intern/appdir.c
@@ -214,6 +214,8 @@ static bool get_path_local(
/* due new codesign situation in OSX > 10.9.5 we must move the blender_version dir with contents to Resources */
static char osx_resourses[FILE_MAX];
sprintf(osx_resourses, "%s../Resources", bprogdir);
+ /* Remove the '/../' added above. */
+ BLI_cleanup_path(NULL, osx_resourses);
return test_path(targetpath, targetpath_len, osx_resourses, blender_version_decimal(ver), relfolder);
#else
return test_path(targetpath, targetpath_len, bprogdir, blender_version_decimal(ver), relfolder);
@@ -591,6 +593,9 @@ static void where_am_i(char *fullname, const size_t maxlen, const char *name)
else {
BLI_path_program_search(fullname, maxlen, name);
}
+ /* Remove "/./" and "/../" so string comparisons can be used on the path. */
+ BLI_cleanup_path(NULL, fullname);
+
#if defined(DEBUG)
if (!STREQ(name, fullname)) {
printf("guessing '%s' == '%s'\n", name, fullname);
More information about the Bf-blender-cvs
mailing list