From: H.G. Muller Date: Wed, 10 Feb 2010 09:58:29 +0000 (+0100) Subject: Fix copying of WB Chat Window contents X-Git-Tag: master-20100221~18 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=9f8e3f62352236d94f044b198a897488d404ed7e;p=xboard.git Fix copying of WB Chat Window contents All line breks were lost on copy-pasting the contents of a chat window. Adding CR to each outputted line in the front-end (wchat.c) solves this. (Tell messages sent to a handle (which are not echoed by the ICS, and thus have to copied to the chat box directly) also need CR!) --- diff --git a/winboard/wchat.c b/winboard/wchat.c index eb5179f..b02e00e 100644 --- a/winboard/wchat.c +++ b/winboard/wchat.c @@ -208,7 +208,7 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam sprintf(buf, "whisper %s\n", mess); // WHISPER box uses "whisper" to send else { if(!atoi(chatPartner[partner])) { - sprintf(buf, "> %s\n", mess); // echo only tells to handle, not channel + sprintf(buf, "> %s\r\n", mess); // echo only tells to handle, not channel InsertIntoMemo(hDlg, buf); sprintf(buf, "xtell %s %s\n", chatPartner[partner], mess); } else @@ -287,5 +287,7 @@ void OutputChatMessage(int partner, char *text) { if(!chatHandle[partner]) return; + int n = strlen(text); + text[n+1] = 0; text[n] = '\n'; text[n-1] = '\r'; // Needs CR to not lose line breaks on copy-paste InsertIntoMemo(chatHandle[partner], text); }