From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Sat, 8 Nov 2003 13:09:10 +0000 (+0000)
Subject: fix for previous commit
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/01b18927f5d2ebde31f0e096283cb993a3cbdfcd

fix for previous commit


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp
index 1c0337284e..071b90f243 100644
--- a/src/common/fileconf.cpp
+++ b/src/common/fileconf.cpp
@@ -494,21 +494,21 @@ wxFileConfig::wxFileConfig(wxInputStream &inStream, wxMBConv& conv)
         wxString strTmp;
 
         char buf[1024];
-        for ( ;; )
+        do
         {
             inStream.Read(buf, WXSIZEOF(buf));
 
-            if ( !inStream.IsOk() )
+            const wxStreamError err = inStream.GetLastError();
+
+            if ( err != wxSTREAM_NO_ERROR && err != wxSTREAM_EOF )
             {
                 wxLogError(_("Error reading config options."));
                 break;
             }
 
             strTmp.append(wxConvertMB2WX(buf), inStream.LastRead());
-
-            if ( inStream.Eof() )
-                break;
         }
+        while ( !inStream.Eof() );
 
         strTrans = wxTextBuffer::Translate(strTmp);
     }