summaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2020-04-09 20:06:43 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2020-04-10 10:32:19 +0300
commite92a14ac5fa8e4fea3254e87b3449302bed3e6dd (patch)
tree2d6c2b76f9d004e40aad7ebd631c14b262ccd8f4 /main/main.cpp
parent4f5ad0734b588f223aa78193b60620d7490e633b (diff)
Ignore process serial number (`-psn_...`) command line argument passed by macOS Gatekeeper.
Diffstat (limited to 'main/main.cpp')
-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();