From: budney@daxus.com (Len Budney)
Subject: Re: Bash termcap and history file
17 Jan 1997 07:02:48 -0800
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <9701171405.AA11624.cygnus.gnu-win32@scosysv.daxus.com>
Original-To: gnu-win32@cygnus.com
In-Reply-To: <32DE640B.2FD@boxhill.com> (message from Jason Tishler on Thu, 16
	Jan 1997 12: 23:23 -0500)
Original-Sender: owner-gnu-win32@cygnus.com

   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..."
budney@daxus.com                 |                              -- Frost
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
