Subject: bug#6674: PATCH: fix assignment of grep-find-use-xargs on Windows/MS-DOS

From: Óscar Fuentes <[email-masked]>
Date: Tue, 20 Jul 2010 21:51:39 +0200

Eli Zaretskii <[email-masked]> writes:

[snip]

> By trial and error I established that the limit beyond which rgrep
> fails is 1024 characters.  This is consistent with the MSDN
> documentation of _spawn, e.g.

[snip]

> So we could either (1) install Óscar's patch, with the disadvantage
> that rgrep will be slower on MS-Windows (because a separate Grep is
> invoked on each file found by Find), or (2) fix cmdproxy to use a
> better API, such as CreateProcess, which doesn't have this limitation.

cmdproxy.c does not call the C runtime `_spawn' function. It defines its
own `spawn' that calls CreateProcess.

The issue is that "cmd.exe -c" seems to have a 1024 char limit when the
command contains a pipe (my guess is that the limit applies separatelly
to every command on the pipe chain) and cmdproxy.c prepends "cmd.exe -c"
to the command when it has a pipe, redirection, etc.

> In any case, please do NOT install the patch for the MS-DOS build.  As
> I wrote earlier, it does not have this problem.

Okay.