| www.delorie.com/archives/browse.cgi | search |
On Wed, May 08, 2002 at 06:53:11PM +0300, Andris Pavenis wrote:
> offset = 0;
> +#ifdef __DJGPP__
> + /* For DJGPP redirected input is opened with O_TEXT by default
> + change it to O_BINARY */
> + if (inc->fd==0)
> + setmode (inc->fd, O_BINARY);
> +#endif
This should be done in open_file():
/* ...
O_BINARY tells some runtime libraries (notably DJGPP) not to do
newline translation; we can handle DOS line breaks just fine
ourselves.
Special case: the empty string is translated to stdin. */
if (filename[0] == '\0')
file->fd = 0;
else
file->fd = open (file->name, O_RDONLY | O_NOCTTY | O_BINARY, 0666);
change that to
if (filename[0] == '\0')
{
file->fd = 0;
#ifdef __DJGPP__
setmode(file->fd, O_BINARY)
#endif
}
else
...
A tested patch that does that and nothing else is preapproved.
^Z handling should be in _cpp_lex_direct. Add a case to the big
switch for '\032', #ifndef HOST_EBCDIC. I want to see this as a
separate patch from any fixes for file mode handling.
zw
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |