X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/daa3509726f9590cecc85f37ef882670667f0650..68b9924c4e76c42929098568482e1718a0fa1d2f:/src/common/cmdline.cpp diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index bb5bd83b93..e8892831ac 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -4,7 +4,6 @@ // Author: Vadim Zeitlin // Modified by: // Created: 05.01.00 -// RCS-ID: $Id$ // Copyright: (c) 2000 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -682,7 +681,15 @@ int wxCmdLineParser::Parse(bool showUsage) continue; } - +#ifdef __WXOSX__ + if ( arg == wxT("-ApplePersistenceIgnoreState") ) + { + maybeOption = false; + + continue; + } +#endif + // empty argument or just '-' is not an option but a parameter if ( maybeOption && arg.length() > 1 && // FIXME-UTF8: use wc_str() after removing ANSI build @@ -1377,6 +1384,23 @@ static wxString GetLongOptionName(wxString::const_iterator p, Windows conventions for the command line handling, not Unix ones. For instance, backslash is not special except when it precedes double quote when it does quote it. + + TODO: Rewrite this to follow the even more complicated rule used by Windows + CommandLineToArgv(): + + * A string of backslashes not followed by a quotation mark has no special + meaning. + * An even number of backslashes followed by a quotation mark is treated as + pairs of protected backslashes, followed by a word terminator. + * An odd number of backslashes followed by a quotation mark is treated as + pairs of protected backslashes, followed by a protected quotation mark. + + See http://blogs.msdn.com/b/oldnewthing/archive/2010/09/17/10063629.aspx + + It could also be useful to provide a converse function which is also + non-trivial, see + + http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx */ /* static */