protected:
HANDLE m_hInput;
- DECLARE_NO_COPY_CLASS(wxPipeInputStream)
+ wxDECLARE_NO_COPY_CLASS(wxPipeInputStream);
};
class wxPipeOutputStream: public wxOutputStream
protected:
HANDLE m_hOutput;
- DECLARE_NO_COPY_CLASS(wxPipeOutputStream)
+ wxDECLARE_NO_COPY_CLASS(wxPipeOutputStream);
};
// define this to let wxexec.cpp know that we know what we're doing
{
// may be NULL or not
data->handler = handler;
+
+ if (handler)
+ handler->SetPid(pi.dwProcessId);
}
DWORD tid;
{
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;