{
pufile->ReadBom();
UINT lineno = 0;
- CString line, eol;
+ CString line, eol, preveol;
+ bool done = false;
// Manually grow line array exponentially
int arraysize = 500;
m_aLines.SetSize(arraysize);
- while (pufile->ReadString(line, eol))
- {
+ do {
+ done = !pufile->ReadString(line, eol);
+
+ // if last line had no eol, we can quit
+ if (done && preveol.IsEmpty())
+ break;
+ // but if last line had eol, we add an extra (empty) line to buffer
+
// Manually grow line array exponentially
if (lineno == arraysize)
{
line += eol;
AppendLine(lineno, line, line.GetLength());
++lineno;
- }
+ preveol = eol;
+ } while (!done);
+
// fix array size (due to our manual exponential growth
m_aLines.SetSize(lineno);
2003-10-23 Perry
BUG: [ 828619 ] Prevent closing dir doc whilst scanning
WinMerge: DirDoc.cpp DirDoc.h
+ BUG: [ 829306 ] Fix unifile code to append last line
+ WinMerge: MergeDoc.cpp
2003-10-23 Kimmo
BUG: [ 815147 ] Scrollwheel scrolls too far at end of file