Don't crash in wxTextFile::GetLastLine() if the file is empty
Just return a reference to an empty wxString, as GetFirstLine() already does (although this is actually questionable -- what if this string is modified?). See #17283.
This commit is contained in:
@@ -117,6 +117,9 @@ void TextFileTestCase::ReadEmpty()
|
||||
CPPUNIT_ASSERT( f.Open(wxString::FromAscii(GetTestFileName())) );
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( (size_t)0, f.GetLineCount() );
|
||||
CPPUNIT_ASSERT( f.Eof() );
|
||||
CPPUNIT_ASSERT_EQUAL( "", f.GetFirstLine() );
|
||||
CPPUNIT_ASSERT_EQUAL( "", f.GetLastLine() );
|
||||
}
|
||||
|
||||
void TextFileTestCase::ReadDOS()
|
||||
|
Reference in New Issue
Block a user