msvcirt: Set error when file can't be opened in ifstream_open_ctor.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2020-09-16 18:52:50 +02:00 committed by Alexandre Julliard
parent 390b885c74
commit a6223249b4
1 changed files with 2 additions and 1 deletions

View File

@ -4213,12 +4213,13 @@ istream* __thiscall ifstream_open_ctor(istream *this, const char *name, ios_open
filebuf_ctor(fb);
istream_sb_ctor(this, &fb->base, virt_init);
filebuf_open(fb, name, mode|OPENMODE_in, protection);
base = istream_get_ios(this);
base->vtable = &MSVCP_ifstream_vtable;
base->delbuf = 1;
if (!filebuf_open(fb, name, mode|OPENMODE_in, protection))
base->state |= IOSTATE_failbit;
return this;
}