diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-25 13:48:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-25 13:48:51 +0300 |
commit | d7d20b483a27286a446ec06df35d3df42c42c060 (patch) | |
tree | 601b2b08dc2e38808440664731718537f719b104 /source | |
parent | 26dab9c2fe15ff2686f92280ee759c2d2cbf299e (diff) |
Revert "Fix (unreported) broken 'get system path' in some cases."
This reverts commit f1bc0aeddedacf68182164dde5d4674d11aba6c9.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/appdir.c | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c index 142449b8aeb..8d4776dca0e 100644 --- a/source/blender/blenkernel/intern/appdir.c +++ b/source/blender/blenkernel/intern/appdir.c @@ -298,36 +298,22 @@ static bool get_path_system_dev_build_exception( char *targetpath, size_t targetpath_len, const char *relfolder) { char cwd[FILE_MAX]; - char tmp_path[FILE_MAX]; - bool ret = false; /* Try EXECUTABLE_DIR/release/folder_name. Allows symlinking release folder from source dir. */ if (test_path(targetpath, targetpath_len, bprogdir, "release", relfolder)) { - ret = true; + return true; } /* Try CWD/release/folder_name. Allows executing Blender from any directory * (usually source dir), even without a release dir in bprogdir. */ if (BLI_current_working_dir(cwd, sizeof(cwd))) { if (test_path(targetpath, targetpath_len, cwd, "release", relfolder)) { - ret = true; - } - } - - /* Ensure we are in source dir, not in another one that happens to have a release folder. */ - if (ret) { - BLI_join_dirfile(tmp_path, sizeof(tmp_path), bprogdir, - "source" SEP_STR "blender" SEP_STR "blenkernel" SEP_STR "BKE_blender_version.h"); - if (!BLI_is_file(tmp_path)) { - ret = false; + return true; } } - /* never use if not existing. */ - if (!ret) { - targetpath[0] = '\0'; - } + targetpath[0] = '\0'; - return ret; + return false; } /** @@ -376,19 +362,10 @@ static bool get_path_system( } } - const char *blender_version_str = blender_version_decimal(ver); - system_base_path = (const char *)GHOST_getSystemDir(ver, blender_version_str); + system_base_path = (const char *)GHOST_getSystemDir(ver, blender_version_decimal(ver)); if (system_base_path) BLI_strncpy(system_path, system_base_path, FILE_MAX); - - /* GHOST_getSystemDir returns nothing in case of portable install, so we try binary directory itself. */ - if (!system_path[0]) { - const char *prog_dir = BKE_appdir_program_dir(); - if (prog_dir != NULL) { - BLI_join_dirfile(system_path, sizeof(system_path), prog_dir, blender_version_str); - } - } - + if (!system_path[0]) return false; |