[Scummvm-cvs-logs] scummvm master -> 4cb5c81192863b6924129c9d4647903d12943364

criezy criezy at scummvm.org
Sun Mar 13 22:52:48 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4cb5c81192 BASE: Ignore -psn command line argument on OS X


Commit: 4cb5c81192863b6924129c9d4647903d12943364
    https://github.com/scummvm/scummvm/commit/4cb5c81192863b6924129c9d4647903d12943364
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2016-03-13T21:51:49Z

Commit Message:
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.

Changed paths:
    base/commandLine.cpp



diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 19702ea..105d810 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] == '-');
 






More information about the Scummvm-git-logs mailing list