• R/O
  • SSH
  • HTTPS

tortoisesvn: コミット


コミットメタ情報

リビジョン29230 (tree)
日時2021-07-21 18:18:04
作者stefankueng

ログメッセージ

変更サマリ

差分

--- trunk/src/TortoiseMerge/FileTextLines.cpp (revision 29229)
+++ trunk/src/TortoiseMerge/FileTextLines.cpp (revision 29230)
@@ -319,7 +319,12 @@
319319 int nReadChars = oFile.GetLength() / sizeof(wchar_t);
320320 wchar_t* pTextBuf = static_cast<wchar_t*>(oFile);
321321 wchar_t* pLineStart = pTextBuf;
322- if ((m_saveParams.unicodeType == UTF8BOM) || (m_saveParams.unicodeType == UTF16_LEBOM) || (m_saveParams.unicodeType == UTF16_BEBOM) || (m_saveParams.unicodeType == UTF32_LE) || (m_saveParams.unicodeType == UTF32_BE))
322+ if (nReadChars &&
323+ ((m_saveParams.unicodeType == UTF8BOM) ||
324+ (m_saveParams.unicodeType == UTF16_LEBOM) ||
325+ (m_saveParams.unicodeType == UTF16_BEBOM) ||
326+ (m_saveParams.unicodeType == UTF32_LE) ||
327+ (m_saveParams.unicodeType == UTF32_BE)))
323328 {
324329 // ignore the BOM
325330 ++pTextBuf;
@@ -604,7 +609,8 @@
604609
605610 void CFileTextLines::SetErrorString()
606611 {
607- m_sErrorString = CFormatMessageWrapper();
612+ LPCWSTR szError = CFormatMessageWrapper();
613+ m_sErrorString = szError;
608614 }
609615
610616 void CFileTextLines::CopySettings(CFileTextLines* pFileToCopySettingsTo) const
@@ -769,6 +775,8 @@
769775 int nFlags = (m_nCodePage == CP_ACP) ? MB_PRECOMPOSED : 0;
770776 // dry decode is around 8 times faster then real one, alternatively we can set buffer to max length
771777 int nReadChars = MultiByteToWideChar(m_nCodePage, nFlags, static_cast<LPCSTR>(data), data.GetLength(), nullptr, 0);
778+ if (!nReadChars)
779+ return FALSE;
772780 m_oBuffer.SetLength(nReadChars * sizeof(wchar_t));
773781 int ret2 = MultiByteToWideChar(m_nCodePage, nFlags, static_cast<LPCSTR>(data), data.GetLength(), static_cast<LPWSTR>(static_cast<void*>(m_oBuffer)), nReadChars);
774782 if (ret2 != nReadChars)
@@ -790,7 +798,7 @@
790798 ///< write preencoded internal buffer
791799
792800 // ReSharper disable once CppMemberFunctionMayBeConst
793-void CBaseFilter::Write(const CBuffer& buffer)
801+void CBaseFilter::Write(const CBuffer& buffer)
794802 {
795803 if (buffer.GetLength())
796804 m_pFile->Write(static_cast<void*>(buffer), buffer.GetLength());
旧リポジトリブラウザで表示