Date: Mon, 15 Jul 1996 13:25:20 +0200 (IST) From: Eli Zaretskii To: "Dr. John Refling" Cc: djgpp AT delorie DOT com, DJ Delorie Subject: Re: fgrep from grep20b.zip crashes my machine.... In-Reply-To: <4scfv2$8fd@overload.lbl.gov> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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)