X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/38c39207e99b6446b3a5b09667f2706c64aae91a..51146826fc0a0a949d88f23fb9d83fc1f1ada14e:/src/msw/utilsexc.cpp?ds=sidebyside diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index b8de30fdff..60dc54d9e1 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/utilsexec.cpp +// Name: src/msw/utilsexc.cpp // Purpose: wxExecute implementation for MSW // Author: Julian Smart // Modified by: @@ -29,14 +29,16 @@ #include "wx/app.h" #include "wx/intl.h" #include "wx/log.h" + #if wxUSE_STREAMS + #include "wx/stream.h" + #endif + #include "wx/module.h" #endif -#include "wx/stream.h" #include "wx/process.h" #include "wx/apptrait.h" -#include "wx/module.h" #include "wx/msw/private.h" @@ -710,43 +712,33 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) #ifndef __WXWINCE__ dwFlags |= CREATE_DEFAULT_ERROR_MODE ; #else - wxString moduleName; - wxString arguments; - int idx = command.Find( wxT(' ') ); - if( idx >= 0 ) - { - moduleName = command.Left(idx); - arguments = command.Mid(idx+1); - } - else - { - moduleName = command; - } + // we are assuming commands without spaces for now + wxString moduleName = command.BeforeFirst(wxT(' ')); + wxString arguments = command.AfterFirst(wxT(' ')); #endif bool ok = ::CreateProcess ( - // WinCE requires appname to be non null + // WinCE requires appname to be non null // Win32 allows for null #ifdef __WXWINCE__ (wxChar *) - moduleName.c_str(), // application name + moduleName.wx_str(),// application name (wxChar *) - arguments.c_str(), // arguments - + arguments.wx_str(), // arguments #else - NULL, // application name (use only cmd line) + NULL, // application name (use only cmd line) (wxChar *) - command.c_str(), // full command line + command.wx_str(), // full command line #endif - NULL, // security attributes: defaults for both - NULL, // the process and its main thread - redirect, // inherit handles if we use pipes - dwFlags, // process creation flags - NULL, // environment (use the same) - NULL, // current directory (use the same) - &si, // startup info (unused here) - &pi // process info + NULL, // security attributes: defaults for both + NULL, // the process and its main thread + redirect, // inherit handles if we use pipes + dwFlags, // process creation flags + NULL, // environment (use the same) + NULL, // current directory (use the same) + &si, // startup info (unused here) + &pi // process info ) != 0; #if wxUSE_STREAMS && !defined(__WXWINCE__) @@ -962,4 +954,3 @@ long wxExecute(wxChar **argv, int flags, wxProcess *handler) return wxExecute(command, flags, handler); } -