diff --git a/dlls/msvcp100/ios.c b/dlls/msvcp100/ios.c index 278abd80f7f..32f36ceb055 100644 --- a/dlls/msvcp100/ios.c +++ b/dlls/msvcp100/ios.c @@ -5821,6 +5821,10 @@ int __thiscall basic_istream_char_peek(basic_istream_char *this) if(basic_istream_char_sentry_create(this, TRUE)) ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base)); basic_istream_char_sentry_destroy(this); + + if (ret == EOF) + basic_ios_char_setstate(base, IOSTATE_eofbit); + return ret; } @@ -6949,6 +6953,10 @@ unsigned short __thiscall basic_istream_wchar_peek(basic_istream_wchar *this) if(basic_istream_wchar_sentry_create(this, TRUE)) ret = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base)); basic_istream_wchar_sentry_destroy(this); + + if (ret == WEOF) + basic_ios_wchar_setstate(base, IOSTATE_eofbit); + return ret; } diff --git a/dlls/msvcp60/ios.c b/dlls/msvcp60/ios.c index 71ff1931a29..0bccd5fdcdf 100644 --- a/dlls/msvcp60/ios.c +++ b/dlls/msvcp60/ios.c @@ -7212,6 +7212,10 @@ int __thiscall basic_istream_char_peek(basic_istream_char *this) if(basic_istream_char_sentry_create(this, TRUE)) ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base)); basic_istream_char_sentry_destroy(this); + + if (ret == EOF) + basic_ios_char_setstate(base, IOSTATE_eofbit); + return ret; } @@ -8467,6 +8471,10 @@ unsigned short __thiscall basic_istream_wchar_peek(basic_istream_wchar *this) if(basic_istream_wchar_sentry_create(this, TRUE)) ret = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base)); basic_istream_wchar_sentry_destroy(this); + + if (ret == WEOF) + basic_ios_wchar_setstate(base, IOSTATE_eofbit); + return ret; } diff --git a/dlls/msvcp71/ios.c b/dlls/msvcp71/ios.c index be8f7443a8f..280ce86a74d 100644 --- a/dlls/msvcp71/ios.c +++ b/dlls/msvcp71/ios.c @@ -7544,6 +7544,10 @@ int __thiscall basic_istream_char_peek(basic_istream_char *this) if(basic_istream_char_sentry_create(this, TRUE)) ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base)); basic_istream_char_sentry_destroy(this); + + if (ret == EOF) + basic_ios_char_setstate(base, IOSTATE_eofbit); + return ret; } @@ -8802,6 +8806,10 @@ unsigned short __thiscall basic_istream_wchar_peek(basic_istream_wchar *this) if(basic_istream_wchar_sentry_create(this, TRUE)) ret = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base)); basic_istream_wchar_sentry_destroy(this); + + if (ret == WEOF) + basic_ios_wchar_setstate(base, IOSTATE_eofbit); + return ret; }