Skip to content

Commit 98ea278

Browse files
authored
Merge pull request #2407 from gwdevhub/claude/issue-2399-20260712-0839
fix(injector): normalize LF to CRLF in changelog before display
2 parents 91994a5 + e960df4 commit 98ea278

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

GWToolbox/Download.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,14 @@ bool DownloadWindow::Create()
480480

481481
void DownloadWindow::SetChangelog(const char* str, const size_t length) const
482482
{
483-
const std::wstring content(str, str + length);
483+
// Win32 Edit control requires CRLF; GitHub release bodies use bare LF
484+
std::wstring content;
485+
content.reserve(length);
486+
for (const char* p = str; p != str + length; ++p) {
487+
if (*p == '\n' && (p == str || p[-1] != '\r'))
488+
content += L'\r';
489+
content += static_cast<wchar_t>(*p);
490+
}
484491
SendMessageW(m_hChangelog, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(content.c_str()));
485492
}
486493

0 commit comments

Comments
 (0)