make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug: make fails to execute .BAT files with space in the path, with S


From: Eli Zaretskii
Subject: Re: Bug: make fails to execute .BAT files with space in the path, with SHELL=cmd.exe
Date: Thu, 02 May 2013 20:44:47 +0300

> Date: Thu, 02 May 2013 20:04:30 +0300
> From: Eli Zaretskii <address@hidden>
> Cc: address@hidden
> 
> > Date: Thu, 02 May 2013 19:50:25 +0300
> > From: Eli Zaretskii <address@hidden>
> > Cc: address@hidden
> > 
> > > SHELL=cmd.exe
> > > default:
> > >         "a b\x.bat"
> > > 
> > > I get this most of the time:
> > > make/gnumake.exe --debug=j
> > > "a b\x.bat"
> > > CreateProcess(NULL,"C:\cygwin\tmp\a b\x.bat",...)
> > > (and make exits with code 127)
> > > 
> > > Sometimes (1 in 5), the bat file is actually executed before make exits
> > > with 127.
> > 
> > That's strange, I cannot reproduce this.  I get 100% success and zero
> > exit code all the time.
> 
> I did succeed in reproducing this.  Stay tuned.

It was a stupid thinko on my part.  Sorry.  Please apply the patch
below on top of the previous one:


--- w32/subproc/sub_proc.c~0    2013-05-02 19:53:47.391000000 +0300
+++ w32/subproc/sub_proc.c      2013-05-02 20:36:54.437875000 +0300
@@ -28,13 +28,13 @@ this program.  If not, see <http://www.g
 #include <signal.h>
 #include <windows.h>
 
+#include "makeint.h"
 #include "sub_proc.h"
 #include "proc.h"
 #include "w32err.h"
 #include "debug.h"
 
 static char *make_command_line(char *shell_name, char *exec_path, char **argv);
-extern char *xmalloc (unsigned int);
 
 typedef struct sub_process_t {
        intptr_t sv_stdin[2];
@@ -690,7 +690,8 @@ process_begin(
                    && batch_file_with_spaces(exec_fname)
                    && _stricmp(exec_path, argv[0]) == 0) {
                        pass_null_exec_path = 1;
-                       argv[0] = exec_fname;
+                       free (argv[0]);
+                       argv[0] = xstrdup(exec_fname);
                }
                command_line = make_command_line( shell_name, exec_fname, argv);
        }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]