diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-11 01:42:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-11 01:42:27 +0300 |
commit | 3d677d9190088aa7fe084767a39158a376cd5d63 (patch) | |
tree | 9a0fc57f419c487871d051f0dbb40faa38241ca7 /source/blender/blenkernel | |
parent | e5604a2fa40bd4b8fdb33f0087ce01ad04e752d4 (diff) |
Fix OSX duplicate path in Python's sys.path
The '..' in the path caused simple comparisons to fail.
D2780 by @akitula
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/appdir.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); |