msvcrt: Drop read buffer in _flsbuf.

This commit is contained in:
Piotr Caban 2015-01-21 16:20:48 +01:00 committed by Alexandre Julliard
parent a884d98e99
commit ba0d1586ff
1 changed files with 15 additions and 3 deletions

View File

@ -3781,12 +3781,24 @@ int CDECL MSVCRT__flsbuf(int c, MSVCRT_FILE* file)
if(!(file->_flag & (MSVCRT__IONBF | MSVCRT__IOMYBUF | MSVCRT__USERBUF))) {
msvcrt_alloc_buffer(file);
}
if(!(file->_flag & MSVCRT__IOWRT)) {
if(file->_flag & MSVCRT__IORW)
file->_flag |= MSVCRT__IOWRT;
else
if(!(file->_flag & MSVCRT__IORW)) {
file->_flag |= MSVCRT__IOERR;
return MSVCRT_EOF;
}
file->_flag |= MSVCRT__IOWRT;
}
if(file->_flag & MSVCRT__IOREAD) {
if(!(file->_flag & MSVCRT__IOEOF)) {
file->_flag |= MSVCRT__IOERR;
return MSVCRT_EOF;
}
file->_cnt = 0;
file->_ptr = file->_base;
file->_flag &= ~(MSVCRT__IOREAD | MSVCRT__IOEOF);
}
if(file->_flag & (MSVCRT__IOMYBUF | MSVCRT__USERBUF)) {
int res = 0;