From: dumser@ti.com (James Dumser)
Subject: Re: Bash termcap and history file
17 Jan 1997 16:34:02 -0800
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <199701171421.IAA21148.cygnus.gnu-win32@lesol1.dseg.ti.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Original-To: jt@boxhill.com
Original-Cc: gnu-win32@cygnus.com
In-Reply-To: <32DE640B.2FD@boxhill.com> from "Jason Tishler" at Jan 16, 97 12:23:23 pm
X-MIMI-Options: headers none
X-Mailer: ELM [version 2.4 PL23]
Content-Length: 824       
Original-Sender: owner-gnu-win32@cygnus.com

On Thu, 16 Jan 1997 12:23:23 -0500, Jason Tishler <jt@boxhill.com> wrote:
>The file size reported by fstat(2) includes the "\r" characters in the
>EOLs.  On the other hand, the number of bytes returned by read(2) does
>not include the "\r" characters because read(2) strips them out from the
>input.  Hence, these quantities will never be equal.  (In fact, they
>always differ by the number of lines in the history file.)
>
>Using the code from history_truncate_file() (in history.c) as a model, I
>changed read_history_range() to save the number of bytes returned by
>read(2) in chars_read.  Then, I used chars_read instead of finfo.st_size
>during the parsing of the history file.

This works, but I would prefer fixing bash to read & write its history
file in binary mode.

-- 
James Dumser    972-462-5335 dumser@ti.com
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
