From 6f49c3e4198ccb420da0fee755874207546b8bcc Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 1 Feb 2016 23:39:07 +0000 Subject: Clean up fl_args for OS X. Xcode and OS X have the annoying habit of adding the process number and debug information on the command line if an an app is inside a bundle. This is a little cleanup that I thought was useful while going through the code. A better solution would be to remove those system specific arguments from the argc/argv list entirely, as they appear totally unexpected for most developers. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11111 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_arg.cxx | 17 +++++++++-------- src/fl_utf8.cxx | 1 + 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Fl_arg.cxx b/src/Fl_arg.cxx index a013f1706..5928fac6a 100644 --- a/src/Fl_arg.cxx +++ b/src/Fl_arg.cxx @@ -175,19 +175,14 @@ int Fl::arg(int argc, char **argv, int &i) { Fl_Tooltip::disable(); i++; return 1; - } #ifdef __APPLE__ - // The Finder application in MacOS X passes the "-psn_N_NNNNN" option - // to all apps... - else if (strcmp(s, "NSDocumentRevisionsDebugMode") == 0) { - i++; - if (argv[i]) i++; - return 1; + // The Finder application in MacOS X passes the "-psn_N_NNNNN" option + // to all apps... } else if (strncmp(s, "psn_", 4) == 0) { i++; return 1; - } #endif // __APPLE__ + } const char *v = argv[i+1]; if (i >= argc-1 || !v) @@ -205,6 +200,12 @@ int Fl::arg(int argc, char **argv, int &i) { Fl::display(v); #endif +#ifdef __APPLE__ + // Xcode in MacOS X may pass "-NSDocumentRevisionsDebugMode YES" + } else if (strcmp(s, "NSDocumentRevisionsDebugMode") == 0) { + // nothing to do +#endif // __APPLE__ + } else if (fl_match(s, "title", 2)) { title = v; diff --git a/src/fl_utf8.cxx b/src/fl_utf8.cxx index be77bb3fc..3dc7a0557 100644 --- a/src/fl_utf8.cxx +++ b/src/fl_utf8.cxx @@ -724,6 +724,7 @@ int fl_stat(const char* f, struct stat *b) { } // fl_stat() +// TODO: add fl_chdir if we have fl_getcwd /** Cross-platform function to get the current working directory as a UTF-8 encoded value. -- cgit v1.2.3