Subject: Re: Bash termcap and history file
From: [email-masked] (James Dumser)

17 Jan 1997 16:34:02 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Original-To: [email-masked]
Original-Cc: [email-masked]
In-Reply-To: <[email-masked]> 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: [email-masked]

On Thu, 16 Jan 1997 12:23:23 -0500, Jason Tishler <[email-masked]> 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 [email-masked]
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".