OSDN Git Service

DiffTextBuffer.cpp: Last line was not saved when last line has no EOL
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Mon, 15 Oct 2018 13:03:15 +0000 (22:03 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Mon, 15 Oct 2018 13:03:15 +0000 (22:03 +0900)
Src/DiffTextBuffer.cpp

index 8a19955..21fab1c 100644 (file)
@@ -572,8 +572,11 @@ int CDiffTextBuffer::SaveToFile (const String& pszFileName,
                if (line == lastRealLine || lastRealLine == -1 )
                {
                        // If original last line had no EOL, then we are done
-                       if( !m_aLines[line].HasEol() )                          
+                       if( !m_aLines[line].HasEol() )
+                       {
+                               file.WriteString(sLine);
                                break;
+                       }
                        // Otherwise, add the appropriate EOL to the last line ...
                }