diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-03-05 20:20:21 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-03-05 20:20:21 +0200 |
commit | 7b77ec860377eafcad05025888721a46b8a7f349 (patch) | |
tree | 2d3176cee22ad946fb4b82e1b8ae40ca656d1a6a /posix/gawkmisc.c | |
parent | 9b1151d32d047649e2a6a1f601aa8163ebe3e8e9 (diff) | |
parent | 28b143c3a489e2699834812214eeaa6347ac1c01 (diff) | |
download | egawk-7b77ec860377eafcad05025888721a46b8a7f349.tar.gz egawk-7b77ec860377eafcad05025888721a46b8a7f349.tar.bz2 egawk-7b77ec860377eafcad05025888721a46b8a7f349.zip |
Merge branch 'gawk-4.2-stable' (after 4.2.1 release)
Diffstat (limited to 'posix/gawkmisc.c')
-rw-r--r-- | posix/gawkmisc.c | 20 |
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 |