Gijs Vermeulen : msvcirt: Set error when file can't be opened in fstream_open_ctor.
Module: wine Branch: master Commit: 19342f43bb34402df76dedbadf0ced52209123ae URL: https://source.winehq.org/git/wine.git/?a=commit;h=19342f43bb34402df76dedbad... Author: Gijs Vermeulen <gijsvrm(a)gmail.com> Date: Thu Sep 17 12:44:15 2020 +0200 msvcirt: Set error when file can't be opened in fstream_open_ctor. Signed-off-by: Gijs Vermeulen <gijsvrm(a)gmail.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcirt/msvcirt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index 3443261934..0b0a34940d 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -4627,13 +4627,14 @@ iostream* __thiscall fstream_open_ctor(iostream *this, const char *name, ios_ope } filebuf_ctor(fb); - filebuf_open(fb, name, mode, protection); iostream_internal_sb_ctor(this, &fb->base, &MSVCP_fstream_vtable, virt_init); base = istream_get_ios(&this->base1); base->delbuf = 1; + if (!filebuf_open(fb, name, mode, protection)) + base->state |= IOSTATE_failbit; return this; }
participants (1)
-
Alexandre Julliard