diff -Nrup textutils-2.0.21.old/src/cat.c textutils-2.0.21.new/src/cat.c --- textutils-2.0.21.old/src/cat.c 2001-12-01 17:29:26.000000000 +0000 +++ textutils-2.0.21.new/src/cat.c 2004-02-21 18:04:29.626361600 +0000 @@ -697,10 +697,13 @@ main (int argc, char **argv) file_open_mode |= O_BINARY; SET_BINARY (0); +#ifndef __CYGWIN__ + /* For Cygwin prefer default handling of text/binary on output */ /* Setting stdin to binary switches the console device to raw I/O, which also affects stdout to console. Undo that. */ if (isatty (STDOUT_FILENO)) setmode (STDOUT_FILENO, O_TEXT); +#endif } #endif @@ -727,6 +730,9 @@ main (int argc, char **argv) { int tty_in = isatty (input_desc); +#ifndef __CYGWIN__ + /* For Cygwin prefer default handling of text/binary + on output */ /* If stdin is a terminal device, and it is the ONLY input file (i.e. we didn't write anything to the output yet), switch the output back to TEXT mode. @@ -735,6 +741,7 @@ main (int argc, char **argv) if (tty_in && optind <= argc) setmode (STDOUT_FILENO, O_TEXT); else +#endif { SET_BINARY (input_desc); # ifdef __DJGPP__