]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utilsexc.cpp
Fixed inability to select no superscript and no subscript in wxRichTextCtrl's
[wxWidgets.git] / src / msw / utilsexc.cpp
index 7c085553ed2893396b5eb1fd6d1375e02593b8da..f67e0eb11d9cf3024b5b7e6f2c9f2f5c1b200dd1 100644 (file)
@@ -1032,16 +1032,28 @@ long wxExecuteImpl(CharType **argv, int flags, wxProcess *handler)
     {
         arg = *argv++;
 
-        // escape any quotes present in the string to avoid interfering with
-        // the command line parsing in the child process
-        arg.Replace("\"", "\\\"", true /* replace all */);
+        bool quote;
+        if ( arg.empty() )
+        {
+            // we need to quote empty arguments, otherwise they'd just
+            // disappear
+            quote = true;
+        }
+        else // non-empty
+        {
+            // escape any quotes present in the string to avoid interfering
+            // with the command line parsing in the child process
+            arg.Replace("\"", "\\\"", true /* replace all */);
 
-        // and quote any arguments containing the spaces to prevent them from
-        // being broken down
-        if ( arg.find_first_of(" \t") == wxString::npos )
-            command += arg;
-        else
+            // and quote any arguments containing the spaces to prevent them from
+            // being broken down
+            quote = arg.find_first_of(" \t") != wxString::npos;
+        }
+
+        if ( quote )
             command += '\"' + arg + '\"';
+        else
+            command += arg;
 
         if ( !*argv )
             break;