diff options
| author | Eli Zaretskii | 2006-06-03 14:51:25 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2006-06-03 14:51:25 +0000 |
| commit | e75dcee327e6ece31d765beff38f6784745c87ce (patch) | |
| tree | e834eedaccc391ac2cc9bf17620a63d1c9cd7020 | |
| parent | c61bea765d6511d69f8e0eb023e071a47b73122d (diff) | |
| download | emacs-e75dcee327e6ece31d765beff38f6784745c87ce.tar.gz emacs-e75dcee327e6ece31d765beff38f6784745c87ce.zip | |
[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.
| -rw-r--r-- | lib-src/sorted-doc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib-src/sorted-doc.c b/lib-src/sorted-doc.c index 0a06aa2c984..67bddbc3304 100644 --- a/lib-src/sorted-doc.c +++ b/lib-src/sorted-doc.c | |||
| @@ -29,9 +29,15 @@ | |||
| 29 | 29 | ||
| 30 | #include <stdio.h> | 30 | #include <stdio.h> |
| 31 | #include <ctype.h> | 31 | #include <ctype.h> |
| 32 | #ifdef DOS_NT | ||
| 33 | #include <fcntl.h> /* for O_BINARY */ | ||
| 34 | #include <io.h> /* for setmode */ | ||
| 35 | #endif | ||
| 32 | #ifndef HAVE_STDLIB_H /* config.h includes stdlib. */ | 36 | #ifndef HAVE_STDLIB_H /* config.h includes stdlib. */ |
| 37 | #ifndef WINDOWSNT /* src/s/ms-w32.h includes stdlib.h */ | ||
| 33 | extern char *malloc (); | 38 | extern char *malloc (); |
| 34 | #endif | 39 | #endif |
| 40 | #endif | ||
| 35 | 41 | ||
| 36 | #define NUL '\0' | 42 | #define NUL '\0' |
| 37 | #define MARKER '\037' | 43 | #define MARKER '\037' |
| @@ -134,6 +140,12 @@ main () | |||
| 134 | DOCSTR *docs = NULL; /* chain of allocated DOCSTRS */ | 140 | DOCSTR *docs = NULL; /* chain of allocated DOCSTRS */ |
| 135 | char buf[512]; /* line buffer */ | 141 | char buf[512]; /* line buffer */ |
| 136 | 142 | ||
| 143 | #ifdef DOS_NT | ||
| 144 | /* DOC is a binary file. */ | ||
| 145 | if (!isatty (fileno (stdin))) | ||
| 146 | setmode (fileno (stdin), O_BINARY); | ||
| 147 | #endif | ||
| 148 | |||
| 137 | while (1) /* process one char at a time */ | 149 | while (1) /* process one char at a time */ |
| 138 | { | 150 | { |
| 139 | /* this char from the DOCSTR file */ | 151 | /* this char from the DOCSTR file */ |