From 63f98fd2d1d5da6cb5de00791eefab9f70b1b126 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Tue, 5 Feb 2013 23:09:10 +0800 Subject: [PATCH] Don't delete files which contain of one line without a line ending Only files that have *only* a line ending and the line is empty otherwise are really empty and can be deleted Based on TortoiseSVN revision 23887 Signed-off-by: Sup Yut Sum (cherry picked from commit 87fc2e0f349c45bfffe2925c933dfb2967035ae1) --- src/TortoiseMerge/MainFrm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TortoiseMerge/MainFrm.cpp b/src/TortoiseMerge/MainFrm.cpp index 3b686a5ac..adf2fd1c6 100644 --- a/src/TortoiseMerge/MainFrm.cpp +++ b/src/TortoiseMerge/MainFrm.cpp @@ -1167,7 +1167,7 @@ int CMainFrame::SaveFile(const CString& sFilePath) if (m_pwndRightView) m_pwndRightView->SetModified(FALSE); CUndo::GetInstance().MarkAsOriginalState(); - if (file.GetCount() == 1 && file.GetLineEnding(0) == EOL_NOENDING) + if (file.GetCount() == 1 && file.GetAt(0).IsEmpty() && file.GetLineEnding(0) == EOL_NOENDING) return 0; return file.GetCount(); } -- 2.11.4.GIT