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

17 Jan 1997 07:02:48 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: [email-masked]
In-Reply-To: <[email-masked]> (message from Jason Tishler on Thu, 16
	Jan 1997 12: 23:23 -0500)
Original-Sender: [email-masked]

   Jason Tishler wrote:

   I found the reason why bash fails to read history files on start up.  It
   has to due with the difference between the end-of-line (EOL) delimiter
   used in Windows and UNIX.  In Windows, EOL is the two character seqence
   "\r\n"; in UNIX, EOL is one character "\n".

   When bash reads a history file, it compares the size of the file as
   reported by fstat(2) to the number of bytes returned by read(2).  If
   they are not equal, then bash will ignore the contents of the history
   file.

Yes!  I noticed the same problem in trying to get Tcl to compile under
GNU-Win32; tcl would not read scripts named on the command line because
it checks the "size" element of the "fstat" structure and compares this
with the number of bytes read.

I "resolved" that particular problem by breaking the equality check and
checking only for a return value of "-1".  Unfortunately, Tcl also 
seems to complain about strange syntax errors that don't exist, but that's
another subject...

Question:  In handling the binary/text dichotomy in GNU-Win32, how do we
handle sneaky inconsistencies like the above?  Should "fstat" be handed a
binary/text flag as well, or should it recognize file types, and handle 
the above problem behind the scenes?

Len.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=
Len Budney Ph.D.                 | "The woods are lovely, dark and deep
Daxus Corporation                |  But I have promises to keep
(412)-577-4156                   |  And miles to go before I sleep..."
[email-masked]                 |                              -- Frost
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".