From d7684c6e8bc6125b14393bcaf461989ff2e81695 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 12 Jul 2016 06:44:32 -0700 Subject: Default stdio streams to text mode. * newlib/libc/stdio/flags.c (__sflags): Enable for Cygwin the piece of code which adds the O_TEXT mode if O_BINARY is not present. And, also, fix that piece of code's incorrect use of the | operator to test a flag instead of &. --- newlib/libc/stdio/flags.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newlib/libc/stdio/flags.c b/newlib/libc/stdio/flags.c index 518cc33f1..7d18fd1d1 100644 --- a/newlib/libc/stdio/flags.c +++ b/newlib/libc/stdio/flags.c @@ -90,8 +90,8 @@ _DEFUN(__sflags, (ptr, mode, optr), break; } } -#if defined (O_TEXT) && !defined (__CYGWIN__) - if (!(m | O_BINARY)) +#if defined (O_TEXT) + if (!(m & O_BINARY)) m |= O_TEXT; #endif *optr = m | o; -- cgit v1.2.3