Fix double paste when CF_UNICODETEXT & CF_HDROP are present (#17543)

Well, this one is rather simple. :)
tl;dr: We shouldn't call `StringPaste` twice for the same paste.

Closes MSFT:51822029
This commit is contained in:
Leonard Hecker 2024-07-12 05:26:04 +02:00 committed by GitHub
parent 04c33f35c3
commit 8c6eaad9ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -75,6 +75,7 @@ void Clipboard::Paste()
// NOTE: Some applications don't add a trailing null character. This includes past conhost versions.
const auto maxLen = GlobalSize(handle) / sizeof(wchar_t);
StringPaste(str, wcsnlen(str, maxLen));
return;
}
// We get CF_HDROP when a user copied a file with Ctrl+C in Explorer and pastes that into the terminal (among others).