]> git.eshelyaron.com Git - emacs.git/commitdiff
[DOS_NT] <top level>: Include fcntl.h and io.h.
authorEli Zaretskii <eliz@gnu.org>
Sat, 3 Jun 2006 15:05:05 +0000 (15:05 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 3 Jun 2006 15:05:05 +0000 (15:05 +0000)
(main) [DOS_NT]: Switch stdin to binary mode, if it is not a terminal device.

lib-src/ChangeLog
lib-src/digest-doc.c

index 61e0d42ab1c86fa0a96a2d6a785d4807c7801854..c448ac31c5d1334984fd2a1d9d61c1fe6ea89891 100644 (file)
@@ -1,9 +1,14 @@
 2006-06-03  Eli Zaretskii  <eliz@gnu.org>
 
+       * digest-doc.c [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.
+
        * sorted-doc.c [DOS_NT] <top level>: Include fcntl.h and io.h.
        [WINDOWSNT] <top level>: Don't redeclare malloc.
        (main) [DOS_NT]: Switch stdin to binary mode, if it is not a
        terminal device.
+       (main): Initialize bp, to avoid compiler warnings
 
        * makefile.w32-in: Delete traces of leditcfns.c.
 
index 7b5a9677e7c793d96056191373beff00d3b5d6ab..7787d422e3939e3bb2eadb5681bab8d50457306e 100644 (file)
 
 #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");