]> git.saurik.com Git - wxWidgets.git/commitdiff
already escaped backslash shouldn't escape the following quote in ConvertStringToArgs()
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 19 Jul 2008 01:53:04 +0000 (01:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 19 Jul 2008 01:53:04 +0000 (01:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54704 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/cmdline.cpp
tests/cmdline/cmdlinetest.cpp

index 95afbfe27f0b262814fffb0e21e40fb1bacb4f75..ce169ac95bf14a8230dab9d703c0fd52559b2c6a 100644 (file)
@@ -1332,7 +1332,7 @@ wxCmdLineParser::ConvertStringToArgs(const wxString& cmdline,
                     break;
                 }
 
-                lastBS = ch == '\\';
+                lastBS = !lastBS && ch == '\\';
             }
             else // type == wxCMD_LINE_SPLIT_UNIX
             {
index e27bcccbba719fc76975339c9947b65bc1717d40..04e5c2ac8364192d2e064355eea1dfb77622584d 100644 (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\"" );