changeset 71195:2a9a6318a6db

[DOS_NT] <top level>: Include fcntl.h and io.h. (main) [DOS_NT]: Switch stdin to binary mode, if it is not a terminal device.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 03 Jun 2006 15:04:49 +0000
parents 036770549c03
children ee0ba955e94b
files lib-src/digest-doc.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/digest-doc.c	Sat Jun 03 14:58:50 2006 +0000
+++ b/lib-src/digest-doc.c	Sat Jun 03 15:04:49 2006 +0000
@@ -26,12 +26,23 @@
 
 #include <stdio.h>
 
+#ifdef DOS_NT
+#include <fcntl.h>		/* for O_BINARY */
+#include <io.h>			/* for setmode */
+#endif
+
 int
 main ()
 {
   register int ch;
   register int notfirst = 0;
 
+#ifdef DOS_NT
+  /* DOC is a binary file.  */
+  if (!isatty (fileno (stdin)))
+    setmode (fileno (stdin), O_BINARY);
+#endif
+
   printf (".TL\n");
   printf ("Command Summary for GNU Emacs\n");
   printf (".AU\nRichard M. Stallman\n");