updated for version 7.0171
diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c
index 299ba37..2b553dd 100644
--- a/src/xxd/xxd.c
+++ b/src/xxd/xxd.c
@@ -146,16 +146,18 @@
#if !defined(CYGWIN) && (defined(CYGWIN32) || defined(__CYGWIN__) || defined(__CYGWIN32__))
# define CYGWIN
#endif
-#if defined(MSDOS) || defined(WIN32) || defined(OS2) || defined(CYGWIN)
+#if defined(MSDOS) || defined(WIN32) || defined(OS2)
# define BIN_READ(yes) ((yes) ? "rb" : "rt")
# define BIN_WRITE(yes) ((yes) ? "wb" : "wt")
# define BIN_CREAT(yes) ((yes) ? (O_CREAT|O_BINARY) : O_CREAT)
# define BIN_ASSIGN(fp, yes) setmode(fileno(fp), (yes) ? O_BINARY : O_TEXT)
-# if defined(CYGWIN)
-# define PATH_SEP '/'
-# else
-# define PATH_SEP '\\'
-# endif
+# define PATH_SEP '\\'
+#elif defined(CYGWIN)
+# define BIN_READ(yes) ((yes) ? "rb" : "rt")
+# define BIN_WRITE(yes) ((yes) ? "wb" : "w")
+# define BIN_CREAT(yes) ((yes) ? (O_CREAT|O_BINARY) : O_CREAT)
+# define BIN_ASSIGN(fp, yes) ((yes) ? (void) setmode(fileno(fp), O_BINARY) : (void) (fp))
+# define PATH_SEP '/'
#else
# ifdef VMS
# define BIN_READ(dummy) "r"