Mail Archives: cygwin/1998/05/01/18:33:33
I noticed while trying to modify BASH that there is a huge problem
introduced when reading a text file which was formatted for DOS. The
problem is with the .DEF compiler in Bash's builtins directory. Here's
what happens:
1) It stats the file to get the size
2) It opens for text mode and reads the entire file into a buffer
The read line looks like this:
if (read (fd, buffer, finfo.st_size) < finfo.st_size/2)
The C function reads finfo.st_size bytes from the file, but then removes
#CR bytes (the number of CR's).
The bug: Even though it removed #CR bytes, it still returns that it
read finfo.st_size bytes, and includes the #CR bytes at the end which
should have been completely thrown out. Because of this, MKBUILTINS.C
writes extra junk to the .C file that it creates, causing a CPP error.
This is probably the reason that so many text programs do not work
anymore.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -