- // 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 */);