From: H.G. Muller Date: Sun, 6 Dec 2009 19:34:50 +0000 (-0800) Subject: remove trailing \r in xboard output X-Git-Tag: hgm-4.20100107~25 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=d13479fa8f80542d1fef82b56c87c8f68573bfba remove trailing \r in xboard output there is an annoying carriage return (displayed as ^M) at the end of the PV in the engine-output window, not only with Fairy-Max, but also with UCI engine running under Polyglot. This patch replaces the trailing CR that Linux programs send after the PV line y a space. --- diff --git a/xengineoutput.c b/xengineoutput.c index f7f5638..bb255fe 100644 --- a/xengineoutput.c +++ b/xengineoutput.c @@ -184,6 +184,10 @@ void InsertIntoMemo( int which, char * text, int where ) { Arg arg; XawTextBlock t; Widget edit; + /* the backend adds \r\n, which is needed for winboard, + * for xboard we delete them again over here */ + if(t.ptr = strchr(text, '\r')) *t.ptr = ' '; + t.ptr = text; t.firstPos = 0; t.length = strlen(text); t.format = XawFmt8Bit; edit = XtNameToWidget(engineOutputShell, which ? "*form2.text" : "*form.text"); XawTextReplace(edit, where, where, &t);