From c85ef27161d814e3da2f4a3249c33e7840e91984 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 6 Dec 2009 11:34:50 -0800 Subject: [PATCH] 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. --- xengineoutput.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/xengineoutput.c b/xengineoutput.c index 2df13d3..70235ab 100644 --- a/xengineoutput.c +++ b/xengineoutput.c @@ -230,6 +230,10 @@ static void InsertIntoMemo( int which, char * text ) { 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, 0, 0, &t); -- 1.7.0.4