]> cygwin.com Git - cygwin-apps/cygutils.git/commitdiff
Bugfix for dump.c under mingw
authorCharles Wilson <cygwin@cwilson.fastmail.fm>
Mon, 16 May 2005 20:35:25 +0000 (20:35 +0000)
committerCharles Wilson <cygwin@cwilson.fastmail.fm>
Mon, 16 May 2005 20:35:25 +0000 (20:35 +0000)
ChangeLog
NEWS
common.h
src/dump/dump.c

index 8121cdf9425759982ba57a8023dbf4187ceaecdc..6798cba12b5a2861881532dc114cb8487498c742 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,11 @@
-2005-05-16  Michael Schaap  >cygstart@...>
+2005-05-16  Kees Zeelenberg  <kzlq@...>
+
+       * src/dump/dump.c: fixes for -mno-cygwin/mingw
+       compatibility.
+       * common.h: ditto
+       * NEWS: update documentation
+
+2005-05-16  Michael Schaap  <cygstart@...>
 
        * src/cygstart/cygstart.c: improve compatibility with
        'mount -X' by syncing env between cygwin and windows.
diff --git a/NEWS b/NEWS
index 388822ea6893faa2f151e7aa9db4e538cfb8d2f0..638e10ed5789469fd5bf86d1436a3a575ea3e9e0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
 1.2.8
   more updates to cygstart (Michael Schaap)
-
+  bugfix for dump under mingw (Kees Zeelenberg)
 
 1.2.7
   Updates to cygstart (Anthony Derosa, Michael Schaap)
index 40c0e83e5b3356dfb1386fdfed86190cb8f0226a..d5665d48eb12c62d2e6ecd70a3df5b4ce339e954 100644 (file)
--- a/common.h
+++ b/common.h
@@ -1,6 +1,21 @@
 #ifndef CYGUTILS_COMMON_H
 #define CYGUTILS_COMMON_H 1
 
+#if defined(_WIN32) || defined(__WIN32) || defined(WIN32) || defined(__WIN32__)
+# ifndef WIN32
+#  define WIN32 1
+# endif
+# ifndef _WIN32
+#  define _WIN32 1
+# endif
+# ifndef __WIN32
+#  define __WIN32 1
+# endif
+# ifndef __WIN32__
+#  define __WIN32__ 1
+# endif
+#endif
+
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif
index aebcef29a00b1731d06c358da43b38fe584d4717..0bd93c0b29b163b1352349c4b9eb11d0f69c02bc 100644 (file)
 
 #include "common.h"
 
+#if defined(__WIN32__) && !defined(__CYGWIN__)
+# include <io.h>
+# include <conio.h>
+#endif
+
 static const char versionID[] = 
     "0.1.1";
 /* for future CVS */
@@ -216,11 +221,13 @@ static void dumpfile(FILE *f) {
       if (isprint(c & 0x7f)) line[50+i] = c & 0x7f;
       if ((c=getc(f)) == EOF) break;
     }
-    if ((address % 256) == 0) {
-#if defined(WIN32) && !defined(__CYGWIN__)
-      while (kbhit())
+    if (address && ((address % 256) == 0)) {
+#if defined(__WIN32__) && !defined(__CYGWIN__)
+      if (isatty (STDOUT_FILENO)) {
+        while (kbhit())
+          getch();
         getch();
-      getch();
+      }
 #endif
       puts("");
       puts("  Addr     0 1  2 3  4 5  6 7  8 9  A B  C D  E F 0 2 4 6 8 A C E ");
This page took 0.031631 seconds and 5 git commands to generate.