Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
authorPaolo Molaro <lupus@oddwiz.org>
Thu, 7 Dec 2006 14:22:10 +0000 (14:22 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Thu, 7 Dec 2006 14:22:10 +0000 (14:22 -0000)
* process.c: ProcessStartInfo may have only filename set and
arguments can be NULL.

svn path=/trunk/mono/; revision=69179

mono/metadata/ChangeLog
mono/metadata/process.c

index 9dd59a996f356ba5cbbc23686579d138c97bfc87..1809f4b8ce1f3a060f51fe0d593f5e965b1be9fb 100644 (file)
@@ -1,4 +1,9 @@
 
+Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
+
+       * process.c: ProcessStartInfo may have only filename set and
+       arguments can be NULL.
+
 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
 
        * icall.c: fix leak found by Robert Jordan.
index 31e0e3f21637fd5bb646edcff4ae46ebf2dd9385..2e47e7184cb720d7f02ecbe4aa7126a3b5945196 100644 (file)
@@ -784,8 +784,6 @@ MonoBoolean ves_icall_System_Diagnostics_Process_CreateProcess_internal (MonoPro
        gchar *spath = NULL;
        MonoString *cmd = proc_start_info->arguments;
        
-       MONO_ARCH_SAVE_REGS;
-
        startinfo.cb=sizeof(STARTUPINFO);
        startinfo.dwFlags=STARTF_USESTDHANDLES;
        startinfo.hStdInput=stdin_handle;
@@ -801,6 +799,7 @@ MonoBoolean ves_icall_System_Diagnostics_Process_CreateProcess_internal (MonoPro
 #ifdef PLATFORM_WIN32
        /* Seems like our CreateProcess does not work as the windows one.
         * This hack is needed to deal with paths containing spaces */
+       /* FIXME: handle a NULL cms, since filename is the only value that must be set */
        shell_path = NULL;
        free_shell_path = FALSE;
        tmp = mono_string_to_utf8 (cmd);
@@ -863,7 +862,7 @@ MonoBoolean ves_icall_System_Diagnostics_Process_CreateProcess_internal (MonoPro
                dir=mono_string_chars (proc_start_info->working_directory);
        }
        
-       ret=CreateProcess (shell_path, mono_string_chars (cmd), NULL, NULL, TRUE, CREATE_UNICODE_ENVIRONMENT, env_vars, dir, &startinfo, &procinfo);
+       ret=CreateProcess (shell_path, cmd? mono_string_chars (cmd): NULL, NULL, NULL, TRUE, CREATE_UNICODE_ENVIRONMENT, env_vars, dir, &startinfo, &procinfo);
 
        g_free (env_vars);
        if (free_shell_path)