X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fbfb8bcc3fa17e079d4219655b173f8ed2ccc65a..ccb5db57cdb1766eefb7023dda50ede9f0d01f78:/src/common/cmdline.cpp?ds=sidebyside diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 197d0eb548..dd154cbaee 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: common/cmdline.cpp +// Name: src/common/cmdline.cpp // Purpose: wxCmdLineParser implementation // Author: Vadim Zeitlin // Modified by: @@ -24,18 +24,18 @@ #pragma hdrstop #endif -#include "wx/cmdline.h" - -#if wxUSE_CMDLINE_PARSER - #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/string.h" #include "wx/log.h" #include "wx/intl.h" #include "wx/app.h" - #include "wx/dynarray.h" #endif //WX_PRECOMP +#include "wx/cmdline.h" + +#if wxUSE_CMDLINE_PARSER + #include #include "wx/datetime.h" @@ -241,7 +241,10 @@ void wxCmdLineParserData::SetArguments(const wxString& cmdLine) { m_arguments.clear(); - m_arguments.push_back(wxTheApp ? wxTheApp->argv[0] : _T("")); + if(wxTheApp && wxTheApp->argc > 0) + m_arguments.push_back(wxTheApp->argv[0]); + else + m_arguments.push_back(wxEmptyString); wxArrayString args = wxCmdLineParser::ConvertStringToArgs(cmdLine); @@ -1220,4 +1223,3 @@ wxArrayString wxCmdLineParser::ConvertStringToArgs(const wxChar *p) return args; } -