From de82cf8bf1d3c281edaa2240a99c004ba209bf7a Mon Sep 17 00:00:00 2001 From: richardg867 Date: Wed, 20 Apr 2022 13:35:14 -0300 Subject: [PATCH] macOS: Fix plat_getcwd on .app bundle --- src/qt/qt_platform.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index 499c6bbac..9a2f2d8a2 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -184,7 +184,12 @@ plat_dir_check(char *path) int plat_getcwd(char *bufp, int max) { +#ifdef __APPLE__ + /* Working directory for .app bundles is undefined. */ + strncpy(bufp, exe_path, max); +#else CharPointer(bufp, max) = QDir::currentPath().toUtf8(); +#endif return 0; }