aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/hexl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib-src/hexl.c b/lib-src/hexl.c
index b090dae335b..417d9f285d1 100644
--- a/lib-src/hexl.c
+++ b/lib-src/hexl.c
@@ -2,6 +2,9 @@
2#include <ctype.h> 2#include <ctype.h>
3#ifdef MSDOS 3#ifdef MSDOS
4#include <fcntl.h> 4#include <fcntl.h>
5#if __DJGPP__ >= 2
6#include <io.h>
7#endif
5#endif 8#endif
6 9
7#define DEFAULT_GROUPING 0x01 10#define DEFAULT_GROUPING 0x01
@@ -134,9 +137,13 @@ main (argc, argv)
134 char buf[18]; 137 char buf[18];
135 138
136#ifdef MSDOS 139#ifdef MSDOS
140#if __DJGPP__ >= 2
141 setmode (fileno (stdout), O_BINARY);
142#else
137 (stdout)->_flag &= ~_IOTEXT; /* print binary */ 143 (stdout)->_flag &= ~_IOTEXT; /* print binary */
138 _setmode (fileno (stdout), O_BINARY); 144 _setmode (fileno (stdout), O_BINARY);
139#endif 145#endif
146#endif
140 for (;;) 147 for (;;)
141 { 148 {
142 register int i, c, d; 149 register int i, c, d;
@@ -178,9 +185,13 @@ main (argc, argv)
178 else 185 else
179 { 186 {
180#ifdef MSDOS 187#ifdef MSDOS
188#if __DJGPP__ >= 2
189 setmode (fileno (stdout), O_BINARY);
190#else
181 (fp)->_flag &= ~_IOTEXT; /* read binary */ 191 (fp)->_flag &= ~_IOTEXT; /* read binary */
182 _setmode (fileno (fp), O_BINARY); 192 _setmode (fileno (fp), O_BINARY);
183#endif 193#endif
194#endif
184 address = 0; 195 address = 0;
185 string[0] = ' '; 196 string[0] = ' ';
186 string[17] = '\0'; 197 string[17] = '\0';