From: Earnie B. <ear...@ya...> - 2002-10-29 12:17:57
|
Wu Yongwei wrote: > Thank Manu for doing the port for MinGW. I would like to contribute my > cents. > > All Win32 native grep.exe (not counting the Cygwin and MSYS versions) I > used has the problem that "grep pattern -" does not work on my Windows > 2000 box. It would report "grep: (standard input): Not enough space". > Today I found the problem tracing the source. It seems a Windows > (MSVCRT; but MSVC 6 with static lib has the problem too) bug -- My > simplest test case shows that "read(0, buf, n)" will return -1 when n is > greater than around 30700. You may test on your PC but I don't know how > widespread the problem is. > > I thus modified the grep source. Modifying the value of INITIAL_BUFSIZE > from 32768 to 16384 (on l. 216 of grep.c) will do the trick. > Please try adding a call to setvbuf(stdin, NULL, _IONBF, 0) as the first funtion executed in main and report. Earnie. |