git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45713
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
All:
- Fix bug in wxFileConfig when recreating a group (Steven Van Ingelgem)
+- Account for lines without newline at the end in wxExecute()
All (Unix):
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