don't use wxFile::Eof() (for the reasons explained in the docs now :-) in wxTextFile - this allows it to be used with FIFOs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7317 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -282,7 +282,7 @@ bool wxTextFile::Read()
|
||||
char ch, chLast = '\0';
|
||||
char buf[1024];
|
||||
int n, nRead;
|
||||
while ( !m_file.Eof() ) {
|
||||
do {
|
||||
nRead = m_file.Read(buf, WXSIZEOF(buf));
|
||||
if ( nRead == wxInvalidOffset ) {
|
||||
// read error (error message already given in wxFile::Read)
|
||||
@@ -325,7 +325,7 @@ bool wxTextFile::Read()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} while ( nRead == WXSIZEOF(buf) );
|
||||
|
||||
// anything in the last line?
|
||||
if ( !str.IsEmpty() ) {
|
||||
|
Reference in New Issue
Block a user