]> code.delx.au - gnu-emacs/blobdiff - lib-src/hexl.c
(mouse-drag-region): Ignore event end-point if it is not a number.
[gnu-emacs] / lib-src / hexl.c
index 417d9f285d1a9e920ddf150189d2d998ee45907d..9731321d4ae2908accc5a12db0ae7c83179bf950 100644 (file)
@@ -1,11 +1,18 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdio.h>
 #include <ctype.h>
-#ifdef MSDOS
+#ifdef DOS_NT
 #include <fcntl.h>
 #if __DJGPP__ >= 2
 #include <io.h>
 #endif
 #endif
+#ifdef WINDOWSNT
+#include <io.h>
+#endif
 
 #define DEFAULT_GROUPING       0x01
 #define DEFAULT_BASE           16
@@ -136,9 +143,10 @@ main (argc, argv)
        {
          char buf[18];
 
-#ifdef MSDOS
-#if __DJGPP__ >= 2
-         setmode (fileno (stdout), O_BINARY);
+#ifdef DOS_NT
+#if (__DJGPP__ >= 2) || (defined WINDOWSNT)
+          if (!isatty (fileno (stdout)))
+           setmode (fileno (stdout), O_BINARY);
 #else
          (stdout)->_flag &= ~_IOTEXT; /* print binary */
          _setmode (fileno (stdout), O_BINARY);
@@ -184,9 +192,10 @@ main (argc, argv)
        }
       else
        {
-#ifdef MSDOS
-#if __DJGPP__ >= 2
-         setmode (fileno (stdout), O_BINARY);
+#ifdef DOS_NT
+#if (__DJGPP__ >= 2) || (defined WINDOWSNT)
+          if (!isatty (fileno (fp)))
+           setmode (fileno (fp), O_BINARY);
 #else
          (fp)->_flag &= ~_IOTEXT; /* read binary */
          _setmode (fileno (fp), O_BINARY);