Maarten Lankhorst : riched20: Do not call callback when no data needs to be flushed.

Alexandre Julliard julliard at winehq.org
Wed Feb 9 15:30:15 CST 2011


Module: wine
Branch: master
Commit: 1e758c5e8c863e24ac1bcffdbbc2e36bb8649f5a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1e758c5e8c863e24ac1bcffdbbc2e36bb8649f5a

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Wed Feb  9 18:49:37 2011 +0100

riched20: Do not call callback when no data needs to be flushed.

---

 dlls/riched20/writer.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/riched20/writer.c b/dlls/riched20/writer.c
index 8c87145..45047bd 100644
--- a/dlls/riched20/writer.c
+++ b/dlls/riched20/writer.c
@@ -54,7 +54,7 @@ ME_StreamOutFlush(ME_OutStream *pStream)
   LONG nRemaining = 0;
   EDITSTREAM *stream = pStream->stream;
 
-  do {
+  while (nStart < pStream->pos) {
     TRACE("sending %u bytes\n", pStream->pos - nStart);
     /* Some apps seem not to set *pcb unless a problem arises, relying
       on initial random nWritten value, which is usually >STREAMOUT_BUFFER_SIZE */
@@ -72,7 +72,7 @@ ME_StreamOutFlush(ME_OutStream *pStream)
       return FALSE;
     pStream->written += nWritten;
     nStart += nWritten;
-  } while (nStart < pStream->pos);
+  }
   pStream->pos = 0;
   return TRUE;
 }




More information about the wine-cvs mailing list