delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/10/20/01:35:16

Date: Sun, 20 Oct 1996 07:32:09 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: DJ Delorie <dj AT delorie DOT com>
Cc: djgpp-workers AT delorie DOT com
Subject: Textutils patch
Message-Id: <Pine.SUN.3.91.961020072959.29425K-100000@is>
Mime-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019