Module: wine Branch: master Commit: 05d9df73d12d202d51b784f1d5eadc55f8448f16 URL: https://source.winehq.org/git/wine.git/?a=commit;h=05d9df73d12d202d51b784f1d...
Author: Zhipeng Zhao zhaozhipeng@uniontech.com Date: Sun Sep 20 21:42:09 2020 +0800
winex11.drv: If the end of the sequence is '\r\n', there is no need to add extra '\r'.
Signed-off-by: Zhipeng Zhao zhaozhipeng@uniontech.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/winex11.drv/clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 8ced781f66..695c0406a8 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -673,7 +673,7 @@ static HANDLE unicode_text_from_string( UINT codepage, const void *data, size_t MultiByteToWideChar( codepage, 0, data, size, strW + count, count ); for (i = j = 0; i < count; i++) { - if (strW[i + count] == '\n') strW[j++] = '\r'; + if (strW[i + count] == '\n' && (!i || strW[i + count - 1] != '\r')) strW[j++] = '\r'; strW[j++] = strW[i + count]; } strW[j++] = 0;