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

Alexandre Julliard julliard at winehq.org
Wed Sep 16 15:37:33 CDT 2020


Module: wine
Branch: master
Commit: a6223249b4ec5ce466dec4e1238f06067da27b56
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a6223249b4ec5ce466dec4e1238f06067da27b56

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Sep 16 18:52:50 2020 +0200

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

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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 99ce1d929c..3443261934 100644
--- a/dlls/msvcirt/msvcirt.c
+++ b/dlls/msvcirt/msvcirt.c
@@ -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;
 }
 




More information about the wine-cvs mailing list