don't drop lines without trailing new line character in wxExecute() with capture
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45713 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -151,6 +151,7 @@ wxX11:
|
||||
All:
|
||||
|
||||
- Fix bug in wxFileConfig when recreating a group (Steven Van Ingelgem)
|
||||
- Account for lines without newline at the end in wxExecute()
|
||||
|
||||
All (Unix):
|
||||
|
||||
|
@@ -556,24 +556,27 @@ static bool ReadAll(wxInputStream *is, wxArrayString& output)
|
||||
|
||||
wxTextInputStream tis(*is);
|
||||
|
||||
bool cont = true;
|
||||
while ( cont )
|
||||
for ( ;; )
|
||||
{
|
||||
wxString line = tis.ReadLine();
|
||||
if ( is->Eof() )
|
||||
break;
|
||||
|
||||
if ( !*is )
|
||||
// check for EOF before other errors as it's not really an error
|
||||
if ( is->Eof() )
|
||||
{
|
||||
cont = false;
|
||||
// add the last, possibly incomplete, line
|
||||
if ( !line.empty() )
|
||||
output.Add(line);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// any other error is fatal
|
||||
if ( !*is )
|
||||
return false;
|
||||
|
||||
output.Add(line);
|
||||
}
|
||||
}
|
||||
|
||||
return cont;
|
||||
return true;
|
||||
}
|
||||
#endif // wxUSE_STREAMS
|
||||
|
||||
|
Reference in New Issue
Block a user