Fix copying of WB Chat Window contents
[xboard.git] / winboard / wchat.c
index 2886b42..4cf8dce 100644 (file)
@@ -3,6 +3,8 @@
  *\r
  * Author: H.G.Muller (August 2009)\r
  *\r
+ * Copyright 2009, 2010 Free Software Foundation, Inc.\r
+ *\r
  * ------------------------------------------------------------------------\r
  *\r
  * GNU XBoard is free software: you can redistribute it and/or modify\r
@@ -277,5 +279,7 @@ void OutputChatMessage(int partner, char *text)
 {\r
        if(!chatHandle[partner]) return;\r
 \r
+       int n = strlen(text);\r
+       text[n+1] = 0; text[n] = '\n'; text[n-1] = '\r'; // Needs CR to not lose line breaks on copy-paste\r
        InsertIntoMemo(chatHandle[partner], text);\r
 }\r