Skip to content

Commit

Permalink
BASE: Ignore -NSDocumentRevisionDebugMode command line argument on OS X
Browse files Browse the repository at this point in the history
This is automatically added by Xcode when not toggling off the
"Allow debugging when using document Versions Browser". Since
this is on by default, and to avoid everybody having to google it,
I have decided to just ignore it on OS X.
  • Loading branch information
criezy committed Feb 6, 2017
1 parent 5da0938 commit 7caeb60
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions base/commandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,15 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
} 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.
// When using XCode it also adds -NSDocumentRevisionsDebugMode YES argument if XCode option
// "Allow debugging when using document Versions Browser" is on (which is the default).
#ifdef MACOSX
if (strncmp(s, "-psn_", 5) == 0)
continue;
if (strcmp(s, "-NSDocumentRevisionsDebugMode") == 0) {
++i; // Also skip the YES that follows
continue;
}
#endif

bool isLongCmd = (s[0] == '-' && s[1] == '-');
Expand Down

0 comments on commit 7caeb60

Please sign in to comment.