aboutsummaryrefslogtreecommitdiffstats
path: root/posix/gawkmisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'posix/gawkmisc.c')
-rw-r--r--posix/gawkmisc.c20
1 files changed, 20 insertions, 0 deletions
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