From 8542445a70b5accf790f1ebb2d915ac459ceadb6 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 13 Aug 1996 17:49:45 +0000 Subject: Fix nasty bracketing/precedence bug. Every time something read (and refilled) a file that was either line- or un-buffered, all files were flushed. According to the code comment, the flush (according to ANSI) is supposed to happen on write + line buffered output files, not _all_ files. Obtained from: OpenBSD / Theo de Raadt, possibly from proven@cygnus.com --- lib/libc/stdio/refill.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/libc/stdio/refill.c b/lib/libc/stdio/refill.c index d30194f..845e0e6 100644 --- a/lib/libc/stdio/refill.c +++ b/lib/libc/stdio/refill.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)refill.c 8.1 (Berkeley) 6/4/93"; #endif static const char rcsid[] = - "$Id$"; + "$Id: refill.c,v 1.3 1996/06/22 10:33:45 jraynard Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -54,7 +54,7 @@ lflush(fp) FILE *fp; { - if ((fp->_flags & (__SLBF|__SWR)) == __SLBF|__SWR) + if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) return (__sflush(fp)); return (0); } -- cgit v1.1