From 19a088202a21bbc9d77103d3ee5f696d6a08defc Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 24 Mar 2006 16:53:12 +0000 Subject: [PATCH] msvcrt: Fix fflush() of files opened for read. Some apps, for no particular reason, call fflush() on files opened for read. This keeps them from tripping over their shoelaces. --- dlls/msvcrt/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 9162ee7e30b..0a99cce7a97 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -588,11 +588,11 @@ int MSVCRT_fflush(MSVCRT_FILE* file) { if(!file) { _flushall(); - return 0; - } else { + } else if(file->_flag & MSVCRT__IOWRT) { int res=msvcrt_flush_buffer(file); return res; } + return 0; } /*********************************************************************