[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fw: Patch to 'tr' utility
From: |
Matthew Smith |
Subject: |
Fw: Patch to 'tr' utility |
Date: |
Sat, 6 Jul 2002 22:54:00 -0500 |
Guys:
Here is a patch from John Sumsion on the cygwin list, for your perusal:
cheers,
-Matt Smith
> 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);
>
- Fw: Patch to 'tr' utility,
Matthew Smith <=