From 5b676d3664cd840749061796bdb93fd24efb5b81 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Mon, 3 Dec 2018 17:03:52 +0100 Subject: [PATCH] Also support tab for folding Signed-off-by: Sven Strickroth --- src/TortoiseProc/SerialPatch.cpp | 2 +- test/UnitTests/SerialPatchTest.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TortoiseProc/SerialPatch.cpp b/src/TortoiseProc/SerialPatch.cpp index 22be2cf23..faa378508 100644 --- a/src/TortoiseProc/SerialPatch.cpp +++ b/src/TortoiseProc/SerialPatch.cpp @@ -59,7 +59,7 @@ int CSerialPatch::Parse(const CString& pathfile, bool parseBody) else if (CStringUtils::StartsWith(line, SUBJECTHEADER)) { CGit::StringAppend(&m_Subject, (BYTE*)(LPCSTR)line + (int)strlen(SUBJECTHEADER), CP_UTF8, line.GetLength() - (int)strlen(SUBJECTHEADER)); - while (m_Body.GetLength() > start && m_Body.GetAt(start) == L' ') + while (m_Body.GetLength() > start && (m_Body.GetAt(start) == L' ' || m_Body.GetAt(start) == L'\t')) { line = m_Body.Tokenize("\n", start); CGit::StringAppend(&m_Subject, (BYTE*)(LPCSTR)line, CP_UTF8, line.GetLength()); diff --git a/test/UnitTests/SerialPatchTest.cpp b/test/UnitTests/SerialPatchTest.cpp index f609c43f4..43ad03584 100644 --- a/test/UnitTests/SerialPatchTest.cpp +++ b/test/UnitTests/SerialPatchTest.cpp @@ -99,7 +99,7 @@ TEST(CSerialPatch, Parse) ASSERT_STREQ(CString(patch1body), parser7.m_strBody); // different order and additional headers - CStringA patch4header = "From c445609da424a6e6229c469e01ce3df5ef099ddd Mon Sep 17 00:00:00 2001\nContent-Type: text/plain\nSubject: [PATCH 2/3] Remove dynamic linking using GetProcAddress() for APIs\nSomething: else\nDate: Sun, 27 Dec 2015 15:49:34 +0100\nFrom: Sven Strickroth \n\n"; + CStringA patch4header = "From c445609da424a6e6229c469e01ce3df5ef099ddd Mon Sep 17 00:00:00 2001\nContent-Type: text/plain\nSubject: [PATCH 2/3] Remove dynamic linking using GetProcAddress()\n\tfor APIs\nSomething: else\nDate: Sun, 27 Dec 2015 15:49:34 +0100\nFrom: Sven Strickroth \n\n"; CStringA patch4body = patch1body; CStringA patch4 = patch4header + patch4body; ASSERT_TRUE(CStringUtils::WriteStringToTextFile(tmpfile, CString(patch4))); @@ -107,14 +107,14 @@ TEST(CSerialPatch, Parse) ASSERT_EQ(0, parser8.Parse(tmpfile, false)); ASSERT_STREQ(L"Sven Strickroth ", parser8.m_Author); ASSERT_STREQ(L"Sun, 27 Dec 2015 15:49:34 +0100", parser8.m_Date); - ASSERT_STREQ(L"[PATCH 2/3] Remove dynamic linking using GetProcAddress() for APIs", parser8.m_Subject); + ASSERT_STREQ(L"[PATCH 2/3] Remove dynamic linking using GetProcAddress()\tfor APIs", parser8.m_Subject); ASSERT_STREQ(patch4, parser8.m_Body); ASSERT_TRUE(parser8.m_strBody.IsEmpty()); CSerialPatch parser9; ASSERT_EQ(0, parser9.Parse(tmpfile, true)); ASSERT_STREQ(L"Sven Strickroth ", parser9.m_Author); ASSERT_STREQ(L"Sun, 27 Dec 2015 15:49:34 +0100", parser9.m_Date); - ASSERT_STREQ(L"[PATCH 2/3] Remove dynamic linking using GetProcAddress() for APIs", parser9.m_Subject); + ASSERT_STREQ(L"[PATCH 2/3] Remove dynamic linking using GetProcAddress()\tfor APIs", parser9.m_Subject); ASSERT_STREQ(patch4, parser9.m_Body); ASSERT_STREQ(CString(patch4body), parser9.m_strBody); } -- 2.11.4.GIT