]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/utilscmn.cpp
compilation fix for wxUSE_INTL=0
[wxWidgets.git] / src / common / utilscmn.cpp
index ebfe32dca0d40c6a6da1fb3c4826ac5f8644c859..0b2f8a28d3da64b22bc1ded6bf77555444168337 100644 (file)
@@ -556,24 +556,27 @@ static bool ReadAll(wxInputStream *is, wxArrayString& output)
 
     wxTextInputStream tis(*is);
 
-    bool cont = true;
-    while ( cont )
+    for ( ;; )
     {
         wxString line = tis.ReadLine();
+
+        // check for EOF before other errors as it's not really an error
         if ( is->Eof() )
+        {
+            // add the last, possibly incomplete, line
+            if ( !line.empty() )
+                output.Add(line);
             break;
+        }
 
+        // any other error is fatal
         if ( !*is )
-        {
-            cont = false;
-        }
-        else
-        {
-            output.Add(line);
-        }
+            return false;
+
+        output.Add(line);
     }
 
-    return cont;
+    return true;
 }
 #endif // wxUSE_STREAMS
 
@@ -845,14 +848,6 @@ bool wxYieldIfNeeded()
     return wxTheApp && wxTheApp->Yield(true);
 }
 
-#endif // wxUSE_BASE
-
-// ============================================================================
-// GUI-only functions from now on
-// ============================================================================
-
-#if wxUSE_GUI
-
 // Id generation
 static long wxCurrentId = 100;
 
@@ -875,6 +870,14 @@ wxRegisterId (long id)
     wxCurrentId = id + 1;
 }
 
+#endif // wxUSE_BASE
+
+// ============================================================================
+// GUI-only functions from now on
+// ============================================================================
+
+#if wxUSE_GUI
+
 // ----------------------------------------------------------------------------
 // Menu accelerators related functions
 // ----------------------------------------------------------------------------
@@ -894,7 +897,6 @@ wxChar *wxStripMenuCodes(const wxChar *in, wxChar *out)
     }
     else
     {
-        // MYcopystring - for easier search...
         out = new wxChar[s.length() + 1];
         wxStrcpy(out, s.c_str());
     }