* cppfiles.c (open_file): Change mode (DJGPP only) of redirected
input to O_BINARY.
From-SVN: r53431
+2002-05-13 Andris Pavenis <pavenis@lanet.lv>
+
+ * cppfiles.c (open_file): Change mode (DJGPP only) of redirected
+ input to O_BINARY.
+
2002-05-13 Jeffrey A Law (law@redhat.com)
* i386.c (ia32_multipass_dfa_lookahead): Prototype.
Special case: the empty string is translated to stdin. */
if (filename[0] == '\0')
- file->fd = 0;
+ {
+ file->fd = 0;
+#ifdef __DJGPP__
+ /* For DJGPP redirected input is opened in text mode. Change it
+ to binary mode. */
+ if (! isatty (file->fd))
+ setmode (file->fd, O_BINARY);
+#endif
+ }
else
file->fd = open (file->name, O_RDONLY | O_NOCTTY | O_BINARY, 0666);