already escaped backslash shouldn't escape the following quote in ConvertStringToArgs()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54704 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-07-19 01:53:04 +00:00
parent e3276230de
commit 28d4f49b78
2 changed files with 2 additions and 1 deletions

View File

@ -1332,7 +1332,7 @@ wxCmdLineParser::ConvertStringToArgs(const wxString& cmdline,
break;
}
lastBS = ch == '\\';
lastBS = !lastBS && ch == '\\';
}
else // type == wxCMD_LINE_SPLIT_UNIX
{

View File

@ -96,6 +96,7 @@ void CmdLineTestCase::ConvertStringTestCase()
WX_ASSERT_ARGS_EQUAL( "1|2 3|4", "1 \"2 3\" 4" );
// check for (broken) Windows semantics: backslash doesn't escape spaces
WX_ASSERT_DOS_ARGS_EQUAL( "\\\\foo\\\\|/bar", "\"\\\\foo\\\\\" /bar" );
WX_ASSERT_DOS_ARGS_EQUAL( "foo|bar\\|baz", "foo bar\\ baz" );
WX_ASSERT_DOS_ARGS_EQUAL( "foo|bar\\\"baz", "foo \"bar\\\"baz\"" );