Fix OSX duplicate path in Python's sys.path

The '..' in the path caused simple comparisons to fail.

D2780 by @akitula
This commit is contained in:
Campbell Barton 2017-08-11 08:42:27 +10:00 committed by Sergey Sharybin
parent 210f839e93
commit 6e7d962118
1 changed files with 5 additions and 0 deletions

View File

@ -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);