From bdd61153a00af769f75d1f20d7938642592cbce9 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 11 Oct 2009 10:13:14 -0700 Subject: [PATCH] Added a command-line option -keepLineBreaksICS true/false to control line joining. --- backend.c | 2 +- common.h | 1 + winboard/winboard.c | 1 + xboard.c | 4 ++++ 4 files changed, 7 insertions(+), 1 deletions(-) diff --git a/backend.c b/backend.c index 6f17d9b..1d03351 100644 --- a/backend.c +++ b/backend.c @@ -2080,7 +2080,7 @@ read_from_ics(isr, closure, data, count, error) for (i = 0; i < count; i++) { if (data[i] != NULLCHAR && data[i] != '\r') buf[buf_len++] = data[i]; - if(buf_len >= 5 && buf[buf_len-5]=='\n' && buf[buf_len-4]=='\\' && + if(!appData.noJoin && buf_len >= 5 && buf[buf_len-5]=='\n' && buf[buf_len-4]=='\\' && buf[buf_len-3]==' ' && buf[buf_len-2]==' ' && buf[buf_len-1]==' ') { buf_len -= 5; // [HGM] ICS: join continuation line of Lasker 2.2.3 server with previous if(buf_len == 0 || buf[buf_len-1] != ' ') diff --git a/common.h b/common.h index 83c6837..9ab3048 100644 --- a/common.h +++ b/common.h @@ -602,6 +602,7 @@ typedef struct { char *fenOverride2; Boolean keepAlive; /* [HGM] alive */ Boolean forceIllegal;/*[HGM] illegal */ + Boolean noJoin; /* [HGM] join */ } AppData, *AppDataPtr; /* [AS] PGN tags (for showing in the game list) */ diff --git a/winboard/winboard.c b/winboard/winboard.c index 34c5cc3..884c85c 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -1392,6 +1392,7 @@ ArgDescriptor argDescriptors[] = { { "firstNPS", ArgInt, (LPVOID) &appData.firstNPS, FALSE }, { "secondNPS", ArgInt, (LPVOID) &appData.secondNPS, FALSE }, { "noGUI", ArgTrue, (LPVOID) &appData.noGUI, FALSE }, + { "keepLineBreaksICS", ArgBoolean, (LPVOID) &appData.noJoin, TRUE }, // [HGM] placement: put all window layouts last in ini file, but man X,Y before all others { "minX", ArgZ, (LPVOID) &minX, FALSE }, // [HGM] placement: to make suer auxialary windows can be placed diff --git a/xboard.c b/xboard.c index b0cd524..8031466 100644 --- a/xboard.c +++ b/xboard.c @@ -1407,6 +1407,9 @@ XtResource clientResources[] = { { "forceIllegalMoves", "forceIllegalMoves", XtRBoolean, sizeof(Boolean), XtOffset(AppDataPtr, forceIllegal), XtRImmediate, (XtPointer) False}, + { "keepLineBreaksICS", "keepLineBreaksICS", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, noJoin), + XtRImmediate, (XtPointer) True}, }; XrmOptionDescRec shellOptions[] = { @@ -1776,6 +1779,7 @@ XrmOptionDescRec shellOptions[] = { { "-secondNeedsNoncompliantFEN", "secondNeedsNoncompliantFEN", XrmoptionSepArg, NULL }, { "-keepAlive", "keepAlive", XrmoptionSepArg, NULL }, { "-forceIllegalMoves", "forceIllegalMoves", XrmoptionNoArg, "True" }, + { "-keepLineBreaksICS", "keepLineBreaksICS", XrmoptionSepArg, NULL }, }; -- 1.7.0.4