aboutsummaryrefslogtreecommitdiffstats
path: root/posix/gawkmisc.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-03-05 20:21:10 +0200
committerArnold D. Robbins <arnold@skeeve.com>2018-03-05 20:21:10 +0200
commit60c5e72ad30f6c2108574f8c072a386302bc0f51 (patch)
tree69065edd511777bb788bc214a3a562d1ecfa953b /posix/gawkmisc.c
parenta0753d1e2b362e9e6b4ea35ff6135505758521f6 (diff)
parent7b77ec860377eafcad05025888721a46b8a7f349 (diff)
downloadegawk-60c5e72ad30f6c2108574f8c072a386302bc0f51.tar.gz
egawk-60c5e72ad30f6c2108574f8c072a386302bc0f51.tar.bz2
egawk-60c5e72ad30f6c2108574f8c072a386302bc0f51.zip
Merge branch 'master' into feature/fix-comments
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