aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-03-05 19:24:17 +0200
committerArnold D. Robbins <arnold@skeeve.com>2018-03-05 19:24:17 +0200
commit28e37a0dc466d96478c3e6a8f087b7be097ed318 (patch)
tree6f08a4e81096efda1c911b93d71160740b2f2f1b
parent9f3ab0384b99ab4f0002339908127baa9d06c859 (diff)
downloadegawk-28e37a0dc466d96478c3e6a8f087b7be097ed318.tar.gz
egawk-28e37a0dc466d96478c3e6a8f087b7be097ed318.tar.bz2
egawk-28e37a0dc466d96478c3e6a8f087b7be097ed318.zip
Restore text mode default processing for MSYS.
-rw-r--r--posix/ChangeLog5
-rw-r--r--posix/gawkmisc.c20
2 files changed, 25 insertions, 0 deletions
diff --git a/posix/ChangeLog b/posix/ChangeLog
index f04902fd..9ec9907c 100644
--- a/posix/ChangeLog
+++ b/posix/ChangeLog
@@ -1,3 +1,8 @@
+2018-03-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.c (cygwin_premain0, cygwin_premain2): Restored for
+ use in MSYS environment only.
+
2018-02-25 Arnold D. Robbins <arnold@skeeve.com>
* 4.2.1: Release tar ball made.
diff --git a/posix/gawkmisc.c b/posix/gawkmisc.c
index ecf5aff9..16cfeb03 100644
--- a/posix/gawkmisc.c
+++ b/posix/gawkmisc.c
@@ -289,3 +289,23 @@ void
init_sockets(void)
{
}
+
+// For MSYS, restore behavior of working in text mode.
+#ifdef __MSYS__
+void
+cygwin_premain0(int argc, char **argv, struct per_process *myself)
+{
+ static struct __cygwin_perfile pf[] = {
+ { "", O_RDONLY | O_TEXT },
+ /*{ "", O_WRONLY | O_BINARY },*/
+ { NULL, 0 }
+ };
+ cygwin_internal(CW_PERFILE, pf);
+}
+
+void
+cygwin_premain2(int argc, char **argv, struct per_process *myself)
+{
+ setmode(fileno (stdin), O_TEXT);
+}
+#endif