diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-11 01:42:27 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-17 15:29:19 +0300 |
commit | 6e7d9621180ac4b48c026defea3c1fd4f132f8ac (patch) | |
tree | aad4664cf912007f89d5291659e75dd3f7d10fdd /source/blender/blenkernel/intern | |
parent | 210f839e93cbb58add43cc3fe9055d0326ca1cc2 (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/intern')
-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); |