diff options
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r-- | libbb/appletlib.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index b74b6e724..dba66cc93 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -828,6 +828,18 @@ int main(int argc UNUSED_PARAM, char **argv) | |||
828 | } | 828 | } |
829 | #endif | 829 | #endif |
830 | 830 | ||
831 | #if defined(__MINGW64_VERSION_MAJOR) | ||
832 | if ( stdin ) { | ||
833 | _setmode(fileno(stdin), _O_BINARY); | ||
834 | } | ||
835 | if ( stdout ) { | ||
836 | _setmode(fileno(stdout), _O_BINARY); | ||
837 | } | ||
838 | if ( stderr ) { | ||
839 | _setmode(fileno(stderr), _O_BINARY); | ||
840 | } | ||
841 | #endif | ||
842 | |||
831 | #if defined(SINGLE_APPLET_MAIN) | 843 | #if defined(SINGLE_APPLET_MAIN) |
832 | /* Only one applet is selected in .config */ | 844 | /* Only one applet is selected in .config */ |
833 | if (argv[1] && strncmp(argv[0], "busybox", 7) == 0) { | 845 | if (argv[1] && strncmp(argv[0], "busybox", 7) == 0) { |