From 4efb5650d15789f9f409b963eb4f9f6de999b51e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 29 Nov 2001 19:47:35 +0000 Subject: [PATCH] fixed backslashes parsing in the cmd line git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/cmdline.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 142cf53dad..efb4a3e966 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -1015,7 +1015,7 @@ wxArrayString wxCmdLineParser::ConvertStringToArgs(const wxChar *p) case _T(' '): case _T('\t'): - if ( isInsideQuotes ) + if ( isInsideQuotes || isQuotedByBS ) { // preserve it, skip endParam below break; @@ -1025,6 +1025,15 @@ wxArrayString wxCmdLineParser::ConvertStringToArgs(const wxChar *p) case _T('\0'): endParam = TRUE; break; + + default: + if ( isQuotedByBS ) + { + // ignore backslash before an ordinary character - this + // is needed to properly handle the file names under + // Windows appearing in the command line + arg += _T('\\'); + } } // end of argument? -- 2.45.2