Commit c52238d6 authored by Mikołaj Zalewski's avatar Mikołaj Zalewski Committed by Alexandre Julliard

wineconsole: Remove spaces from the ends of lines while copying to the clipboard.

parent 2750a74f
......@@ -689,8 +689,15 @@ static void WCUSER_CopySelectionToClipboard(const struct inner_data* data)
for (y = 0; y < h; y++, c.Y++)
{
ReadConsoleOutputCharacter(data->hConOut, &p[y * w], w - 1, c, NULL);
p[y * w + w - 1] = (y < h - 1) ? '\n' : '\0';
LPWSTR end;
ReadConsoleOutputCharacter(data->hConOut, p, w - 1, c, NULL);
/* strip spaces from the end of the line */
end = p + w - 1;
while (end > p && *(end - 1) == ' ')
end--;
*end = (y < h - 1) ? '\n' : '\0';
p = end + 1;
}
GlobalUnlock(hMem);
SetClipboardData(CF_UNICODETEXT, hMem);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment