[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fw: Patch to 'tr' utility
From: |
Jim Meyering |
Subject: |
Re: Fw: Patch to 'tr' utility |
Date: |
Mon, 08 Jul 2002 15:09:18 +0200 |
User-agent: |
Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.3.50 (i686-pc-linux-gnu) |
"Matthew Smith" <address@hidden> wrote:
> Here is a patch from John Sumsion on the cygwin list, for your perusal:
Thanks, but what is the motivation for this?
Does this mean that every text-filtering program
(e.g., sort, cut, fold, join, etc.) should to do something similar?
>> Here is a patch that ensures that tr console output is NOT buffered. I
>> only use cygwin, so I have no idea if this builds right on linux or any
>> other platform.
>>
>> diff -u -r textutils-2.0.21/src/tr.c textutils-2.0.21.jgs/src/tr.c
>> --- textutils-2.0.21/src/tr.c 2002-02-11 01:34:16.000000000 -0700
>> +++ textutils-2.0.21.jgs/src/tr.c 2002-06-25 15:41:28.000000000 -0600
>> @@ -1894,6 +1894,9 @@
>> by text-mode reads (like CR and ^Z). */
>> SET_BINARY2 (STDIN_FILENO, STDOUT_FILENO);
>>
>> + /* Do not buffer console output. */
>> + if (isatty((int) stdout)) SETVBUF (stdout, NULL, _IONBF, 0);
>> +
>> if (squeeze_repeats && non_option_args == 1)
>> {
>> set_initialize (s1, complement, in_squeeze_set);
>>