[2/2] msvcirt: Fix implementation of streambuf::sync

Iván Matellanes matellanesivan at gmail.com
Thu Jun 11 15:33:29 CDT 2015


---
 dlls/msvcirt/msvcirt.c       | 2 +-
 dlls/msvcirt/tests/msvcirt.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c
index ae644b3..8c05fe3 100644
--- a/dlls/msvcirt/msvcirt.c
+++ b/dlls/msvcirt/msvcirt.c
@@ -457,7 +457,7 @@ DEFINE_THISCALL_WRAPPER(streambuf_sync, 4)
 int __thiscall streambuf_sync(streambuf *this)
 {
     TRACE("(%p)\n", this);
-    return (this->gptr == this->egptr && this->pbase == this->pptr) ? 0 : EOF;
+    return (this->gptr >= this->egptr && this->pbase >= this->pptr) ? 0 : EOF;
 }
 
 /* ?unbuffered at streambuf@@IAEXH at Z */
diff --git a/dlls/msvcirt/tests/msvcirt.c b/dlls/msvcirt/tests/msvcirt.c
index 0aeda17..ff1981b 100644
--- a/dlls/msvcirt/tests/msvcirt.c
+++ b/dlls/msvcirt/tests/msvcirt.c
@@ -372,7 +372,7 @@ static void test_streambuf(void)
     ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
     sb.gptr = sb.egptr + 1;
     ret = (int) call_func1(p_streambuf_sync, &sb);
-    todo_wine ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
+    ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
     sb.gptr = sb.eback;
     ret = (int) call_func1(p_streambuf_sync, &sb2);
     ok(ret == EOF, "sync failed, expected EOF got %d\n", ret);
@@ -381,7 +381,7 @@ static void test_streambuf(void)
     ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
     sb2.pptr = sb2.pbase - 1;
     ret = (int) call_func1(p_streambuf_sync, &sb2);
-    todo_wine ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
+    ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
     sb2.pptr = sb2.epptr;
     ret = (int) call_func1(p_streambuf_sync, &sb3);
     ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
-- 
2.1.4




More information about the wine-patches mailing list