aboutsummaryrefslogtreecommitdiff
path: root/base/commandLine.cpp
diff options
context:
space:
mode:
authorThierry Crozat2016-03-13 21:51:23 +0000
committerThierry Crozat2016-03-13 21:51:49 +0000
commit4cb5c81192863b6924129c9d4647903d12943364 (patch)
treed901c531b23e85655075d8130b295cbafc197cd4 /base/commandLine.cpp
parentedfc84b67ad625b288192c4bc65bce0fe3c12169 (diff)
downloadscummvm-rg350-4cb5c81192863b6924129c9d4647903d12943364.tar.gz
scummvm-rg350-4cb5c81192863b6924129c9d4647903d12943364.tar.bz2
scummvm-rg350-4cb5c81192863b6924129c9d4647903d12943364.zip
BASE: Ignore -psn command line argument on OS X
Prior to OS X 10.9, the OS was passing the process serial number as an additional argument on OS X when starting an application bundle. For whatever reason, when compiling with SDL 1.2 this gets suppressed before getting to the place where we handle command line arguments. But when compiling with SDL2 this additional argument remains so we need to ignore it to avoid erroring out.
Diffstat (limited to 'base/commandLine.cpp')
-rw-r--r--base/commandLine.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 19702ea36d..105d810460 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -373,6 +373,12 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
// We defer checking whether this is a valid target to a later point.
return s;
} else {
+ // On MacOS X prior to 10.9 the OS is sometimes adding a -psn_X_XXXXXX argument (where X are digits)
+ // to pass the process serial number. We need to ignore it to avoid an error.
+#ifdef MACOSX
+ if (strncmp(s, "-psn_", 5) == 0)
+ continue;
+#endif
bool isLongCmd = (s[0] == '-' && s[1] == '-');