Mail Archives: djgpp-workers/1996/10/20/01:35:16
The following patch is needed to correct the text/binary mode hassles
with two of the programs in the Textutils package. Without the patch,
you will have extra ^M characters added sometimes.
*** gnu/txtutil1.19/src/tail.c~1 Sun Aug 4 15:30:34 1996
--- gnu/txtutil1.19/src/tail.c Fri Oct 18 19:43:30 1996
*************** main (int argc, char **argv)
*** 1014,1020 ****
/* We need binary I/O, since `tail' relies on `lseek' and byte counts. */
_fmode = O_BINARY;
if (!isatty (0))
! setmode (0, O_BINARY);
#endif
if (n_files == 0)
--- 1014,1024 ----
/* We need binary I/O, since `tail' relies on `lseek' and byte counts. */
_fmode = O_BINARY;
if (!isatty (0))
! {
! setmode (0, O_BINARY);
! if (!isatty (1))
! setmode (1, O_BINARY);
! }
#endif
if (n_files == 0)
*** gnu/txtutil1.19/src/tac.c~1 Sun Aug 4 15:36:42 1996
--- gnu/txtutil1.19/src/tac.c Fri Oct 18 19:43:54 1996
*************** main (int argc, char **argv)
*** 632,641 ****
/* We need binary input, since `tac' relies on `lseek' and byte counts. */
_fmode = O_BINARY;
if (!isatty (0))
! setmode (0, O_BINARY);
! /* Binary output will leave the lines' ends (NL or CR/LF) intact. */
! if (!isatty (STDOUT_FILENO))
! setmode (STDOUT_FILENO, O_BINARY);
#endif
if (sentinel_length == 0)
--- 632,643 ----
/* We need binary input, since `tac' relies on `lseek' and byte counts. */
_fmode = O_BINARY;
if (!isatty (0))
! {
! setmode (0, O_BINARY);
! /* Binary output will leave the lines' ends (NL or CR/LF) intact. */
! if (!isatty (STDOUT_FILENO))
! setmode (STDOUT_FILENO, O_BINARY);
! }
#endif
if (sentinel_length == 0)
- Raw text -