summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-04-10 10:44:05 +0200
committerGitHub <noreply@github.com>2020-04-10 10:44:05 +0200
commit4c36feb18045461bd53bfd2f67f74af7631d6339 (patch)
tree943e5b54aebaba29dc1b9f2ea3a8a713b386a2c7
parentc2f0d58c3646b0bb7631edac29d30443aaae9dd0 (diff)
parente92a14ac5fa8e4fea3254e87b3449302bed3e6dd (diff)
Merge pull request #37719 from bruvzg/macos_ignore_psn
Ignore process serial number argument passed by macOS Gatekeeper.
-rw-r--r--main/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 92f40588f2..fb42f71a75 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -478,6 +478,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
I = args.front();
while (I) {
+#ifdef OSX_ENABLED
+ // Ignore the process serial number argument passed by macOS Gatekeeper.
+ // Otherwise, Godot would try to open a non-existent project on the first start and abort.
+ if (I->get().begins_with("-psn_")) {
+ I = I->next();
+ continue;
+ }
+#endif
List<String>::Element *N = I->next();