Mail Archives: djgpp/1996/07/15/06:29:48
On 15 Jul 1996, Dr. John Refling wrote:
> I think that grep does too. I haven't analysed it very well, but it seems
> to me that unbalanced qoutes kill it. For example:
>
> fgrep "
>
> sends my machine to its death. Anybody else notice this?
That bug was corrected ages ago! Your machine isn't dead, it just sits
there waiting for input endlessly (because, when the command line is
empty, the defaqult behavior is to read stdin), and you cannot interrupt
it because of the way signals are implemented in DJGPP v2. I've uploaded
a corrected version to DJ Delorie's server somewhere in April, but it
still didn't make it to SimTel as of this writing...
If you care to build it yourself, download the sources (grep20s.zip),
apply the patch below, then recompile Grep.
*** grep.c~0 Tue Sep 26 12:07:08 1995
--- grep.c Mon Mar 11 18:37:58 1996
*************** main(argc, argv)
*** 847,853 ****
{
#ifdef __MSDOS__
/* This allows to grep through binary files, even from a pipe. */
! setmode(desc, O_BINARY);
#endif
filename = desc == 0 ? "(standard input)" : argv[optind];
count = grep(desc);
--- 847,854 ----
{
#ifdef __MSDOS__
/* This allows to grep through binary files, even from a pipe. */
! if (!isatty(desc))
! setmode(desc, O_BINARY);
#endif
filename = desc == 0 ? "(standard input)" : argv[optind];
count = grep(desc);
*************** main(argc, argv)
*** 874,880 ****
{
filename = "(standard input)";
#ifdef __MSDOS__
! setmode(0, O_BINARY);
#endif
count = grep(0);
if (count_matches)
--- 875,882 ----
{
filename = "(standard input)";
#ifdef __MSDOS__
! if (!isatty(0))
! setmode(0, O_BINARY);
#endif
count = grep(0);
if (count_matches)
- Raw text -