msvcrt: fix fflush() of files opened for read, fixes bug 4831

dank at vroo.pair.com dank at vroo.pair.com
Fri Mar 24 10:53:12 CST 2006


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	17 Feb 2006 17:42:52 -0000	1.97
+++ dlls/msvcrt/file.c	24 Mar 2006 16:47:55 -0000
@@ -588,11 +588,11 @@
 {
   if(!file) {
 	_flushall();
-	return 0;
-  } else {
+  } else if(file->_flag & MSVCRT__IOWRT) {
   	int res=msvcrt_flush_buffer(file);
   	return res;
   }
+  return 0;
 }
 
 /*********************************************************************



More information about the wine-patches mailing list