X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/906c935a80b10d53cecf57f71ab5f3f4f1d529ec..038c99477c8cd14013cef892517012717c47df35:/src/common/cmdline.cpp diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 2952c2d6ae..2d6feae46b 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -969,8 +969,8 @@ int wxCmdLineParser::Parse(bool showUsage) case wxCMD_LINE_VAL_DATE: { wxDateTime dt; - wxString::const_iterator end; - if ( !dt.ParseDate(value, &end) || end != value.end() ) + wxString::const_iterator endDate; + if ( !dt.ParseDate(value, &endDate) || endDate != value.end() ) { errorMsg << wxString::Format(_("Option '%s': '%s' cannot be converted to a date."), name.c_str(), value.c_str()) @@ -1377,6 +1377,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 */