This makefile reproduces the problem:

SHELL=cmd.exe
default:
    ./x.bat ""
    ./x.bat

The first line succeeds on make 3.82, while the second line fails. With
master, both lines fail (because the first one is short-circuited as well)

It seems that the problem happens only when it is a path to a bat file, and
the path starts with '../' or './'. Other relative paths, or paths with
backslashes, all work.

I have one suggestion: Rather than pursuing the Sisyphean task to invoke
CreateProcess correctly on bat files, why don't you just give up the
short-circuiting for all .bat files, and go through the cmd.exe invocation
path (i.e., create a temporary bat file with the command invocation)
whenever argv[0] ends with .bat? That shouldn't affect performance much (a
cmd.exe process will be spawned in either case), and it seems that the
4k/8k command-line length limit applies to any invocations of bat files,
even when executed directly with CreateProcess.
_______________________________________________
Make-w32 mailing list
Make-w32@gnu.org
https://lists.gnu.org/mailman/listinfo/make-w32

Reply via email to