don't drop lines without trailing new line character in wxExecute() with capture [backport from HEAD]

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45714 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-04-30 01:17:43 +00:00
parent 611d0e5cea
commit 1885d4d4e2
2 changed files with 16 additions and 12 deletions

View File

@@ -94,6 +94,7 @@ Major new features in 2.8 release
All:
- Fix bug in wxFileConfig when recreating a group (Steven Van Ingelgem)
- Account for lines without newline at the end in wxExecute()
- Added wxString::char_str() and wchar_str() methods for forward
compatiblity with wxWidgets 3

View File

@@ -647,24 +647,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;
// 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