diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2004-05-19 21:59:11 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2004-05-19 21:59:11 +0400 |
commit | d41151034ace004cae390b3be85b4350606a2e32 (patch) | |
tree | 4e3d3451f8acab68b81766026bf57efdc4a58bb4 /mcs/class/System/System.Diagnostics | |
parent | 65b9ee31d43b2283153b71c846d174782ee8f853 (diff) |
2004-05-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Process.cs: separate the command and the arguments when calling
Start_internal.
svn path=/trunk/mcs/; revision=27695
Diffstat (limited to 'mcs/class/System/System.Diagnostics')
-rw-r--r-- | mcs/class/System/System.Diagnostics/ChangeLog | 12 | ||||
-rwxr-xr-x | mcs/class/System/System.Diagnostics/Process.cs | 21 |
2 files changed, 27 insertions, 6 deletions
diff --git a/mcs/class/System/System.Diagnostics/ChangeLog b/mcs/class/System/System.Diagnostics/ChangeLog index 0c0bedfbf1b..d8bb8741ceb 100644 --- a/mcs/class/System/System.Diagnostics/ChangeLog +++ b/mcs/class/System/System.Diagnostics/ChangeLog @@ -1,13 +1,19 @@ 2004-05-19 Gonzalo Paniagua Javier <gonzalo@ximian.com> + * Process.cs: separate the command and the arguments when calling + Start_internal. + +2004-05-19 Gonzalo Paniagua Javier <gonzalo@ximian.com> + * Process.cs: redirecting I/O is not permitted if UseShellExecute is false. Also throw if FileName is null. 2004-04-06 Lluis Sanchez Gual <lluis@ximian.com> - * DiagnosticsConfigurationHandler.cs: If initializeData is provided, use the - constructor that only takes one string as parameter to construct the - listener. The name is set using the Name property, not the constructor. + * DiagnosticsConfigurationHandler.cs: If initializeData is provided, + use the constructor that only takes one string as parameter to + construct the listener. The name is set using the Name property, not the + constructor. * TextWriterTraceListener.cs: In Write*, do nothing if no writer was provided. diff --git a/mcs/class/System/System.Diagnostics/Process.cs b/mcs/class/System/System.Diagnostics/Process.cs index eb7830ce646..54b594e83b7 100755 --- a/mcs/class/System/System.Diagnostics/Process.cs +++ b/mcs/class/System/System.Diagnostics/Process.cs @@ -666,7 +666,8 @@ namespace System.Diagnostics { } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static bool Start_internal(string cmd, + private extern static bool Start_internal(string appname, + string cmdline, string dir, IntPtr stdin, IntPtr stdout, @@ -734,8 +735,22 @@ namespace System.Diagnostics { stderr_wr=MonoIO.ConsoleError; } - ret=Start_internal(startInfo.FileName + " " + - startInfo.Arguments, + string cmdline; + string appname; + if (startInfo.UseShellExecute) { + appname = null; + string args = startInfo.Arguments; + if (args == null || args.Trim () == "") + cmdline = startInfo.FileName; + else + cmdline = startInfo.FileName + " " + startInfo.Arguments.Trim (); + } else { + appname = startInfo.FileName; + cmdline = startInfo.Arguments.Trim (); + } + + ret=Start_internal(appname, + cmdline, startInfo.WorkingDirectory, stdin_rd, stdout_wr, stderr_wr, ref proc_info); |