diff --git a/release/datafiles/locale b/release/datafiles/locale index 08b372721b9b..4331c8e76c2f 160000 --- a/release/datafiles/locale +++ b/release/datafiles/locale @@ -1 +1 @@ -Subproject commit 08b372721b9b33a16f380cab23b2e5ded738ea96 +Subproject commit 4331c8e76c2f42b9fd903716c333d6cdeaa5cebd diff --git a/release/scripts/addons b/release/scripts/addons index d887a4ea6b2a..48320b2d9f3d 160000 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit d887a4ea6b2a9d64b926034d4e78ecf7a48ca979 +Subproject commit 48320b2d9f3d829c46ae4a6a6aab0bd94e80c830 diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib index 9d538629bb8a..14ab9273409e 160000 --- a/release/scripts/addons_contrib +++ b/release/scripts/addons_contrib @@ -1 +1 @@ -Subproject commit 9d538629bb8a425991c7d10a49bab1ba0788c18f +Subproject commit 14ab9273409ea0231d08ba6e86fdc73d4e459e99 diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index 614a0e952f51..9a10358dceab 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -325,8 +325,6 @@ void BLI_file_free_lines(struct LinkNode *lines); * Giving a path without leading `~` is not an error. */ const char *BLI_expand_tilde(const char *path_with_tilde); -const char *BLI_apple_getcwd(const size_t max_length); -int BLI_apple_chdir(const char *dir); #endif /* This weirdo pops up in two places. */ #if !defined(WIN32) diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index f39ac54c4009..eed492d4cb3a 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -57,6 +57,7 @@ #include "BLI_threads.h" #include "BLI_utildefines.h" +#if !defined (__APPLE__) bool BLI_change_working_dir(const char *dir) { BLI_assert(BLI_thread_is_main()); @@ -70,8 +71,6 @@ bool BLI_change_working_dir(const char *dir) return false; } return _wchdir(wdir) == 0; -#elif defined(__APPLE__) - return BLI_apple_chdir(dir) == 0; #else int result = chdir(dir); if (result == 0) { @@ -91,9 +90,6 @@ char *BLI_current_working_dir(char *dir, const size_t maxncpy) } } return NULL; -#elif defined(__APPLE__) - BLI_strncpy(dir, BLI_apple_getcwd(maxncpy), maxncpy); - return dir; #else const char *pwd = BLI_getenv("PWD"); if (pwd) { @@ -107,6 +103,7 @@ char *BLI_current_working_dir(char *dir, const size_t maxncpy) return getcwd(dir, maxncpy); #endif } +#endif double BLI_dir_free_space(const char *dir) { diff --git a/source/blender/blenlib/intern/storage_apple.mm b/source/blender/blenlib/intern/storage_apple.mm index d79a249dbef1..bc071872c6d8 100644 --- a/source/blender/blenlib/intern/storage_apple.mm +++ b/source/blender/blenlib/intern/storage_apple.mm @@ -13,6 +13,8 @@ #include "BLI_fileops.h" #include "BLI_path_util.h" +#include "BLI_string.h" + /* Extended file attribute used by OneDrive to mark placeholder files. */ static const char *ONEDRIVE_RECALLONOPEN_ATTRIBUTE = "com.microsoft.OneDrive.RecallOnOpen"; @@ -186,26 +188,26 @@ const char *BLI_expand_tilde(const char *path_with_tilde) return path_expanded; } - -const char *BLI_apple_getcwd(const size_t max_length) { +char *BLI_current_working_dir(char *dir, const size_t maxncpy) { + /* Can't just copy to the *dir pointer, as [path getCString gets grumpy.*/ static char path_expanded[PATH_MAX]; @autoreleasepool { NSString *path = [[NSFileManager defaultManager] currentDirectoryPath]; - const size_t length = max_length > PATH_MAX ? PATH_MAX : max_length; - [path getCString:path_expanded maxLength: length encoding:NSUTF8StringEncoding]; + const size_t length = maxncpy > PATH_MAX ? PATH_MAX : maxncpy; + [path getCString:path_expanded maxLength:length encoding:NSUTF8StringEncoding]; + BLI_strncpy(dir, path_expanded, maxncpy); return path_expanded; } } - -int BLI_apple_chdir(const char* dir) { +bool BLI_change_working_dir(const char* dir) { @autoreleasepool { NSString* path = [[NSString alloc] initWithUTF8String: dir]; if ([[NSFileManager defaultManager] changeCurrentDirectoryPath: path] == YES) { - return 0; + return false; } else { - return -1; + return true; } } } diff --git a/source/tools b/source/tools index 3582f5326d08..e133fc08cd32 160000 --- a/source/tools +++ b/source/tools @@ -1 +1 @@ -Subproject commit 3582f5326d08ca05c2a19056597e49ec5511d854 +Subproject commit e133fc08cd3254bb3d3bd1345028c8486700bca4