From 1b178b9902fce72c5e08cb0ef6527615477f510f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 3 Jun 2006 15:05:05 +0000 Subject: [PATCH] [DOS_NT] : Include fcntl.h and io.h. (main) [DOS_NT]: Switch stdin to binary mode, if it is not a terminal device. --- lib-src/ChangeLog | 5 +++++ lib-src/digest-doc.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 61e0d42ab1c..c448ac31c5d 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,9 +1,14 @@ 2006-06-03 Eli Zaretskii + * digest-doc.c [DOS_NT] : 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] : Include fcntl.h and io.h. [WINDOWSNT] : 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. diff --git a/lib-src/digest-doc.c b/lib-src/digest-doc.c index 7b5a9677e7c..7787d422e39 100644 --- a/lib-src/digest-doc.c +++ b/lib-src/digest-doc.c @@ -26,12 +26,23 @@ #include +#ifdef DOS_NT +#include /* for O_BINARY */ +#include /* 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"); -- 2.39.5