Mail Archives: cygwin/1997/01/17/07:02:48
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 AT daxus DOT com | -- Frost
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -