From: H.G.Muller Date: Tue, 29 Dec 2015 19:43:39 +0000 (+0100) Subject: Fix parsing of pieceToChar strings X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=c6cb9e16126dd82a6727d4ca9f3a3507dbfb92ab;p=xboard.git Fix parsing of pieceToChar strings The skipping to the chu-promoted series was not working. The character that triggers the skipping has been changed from : to /, because : is a narrow character potentially useful as ID suffix. --- diff --git a/backend.c b/backend.c index 7749cba..b2ec75a 100644 --- a/backend.c +++ b/backend.c @@ -5956,7 +5956,7 @@ ptclen (const char *s, char *escapes) { int n = 0; if(!*escapes) return strlen(s); - while(*s) n += (*s != ':' && !strchr(escapes, *s)), s++; + while(*s) n += (*s != '/' && !strchr(escapes, *s)), s++; return n; } @@ -5965,25 +5965,25 @@ SetCharTableEsc (unsigned char *table, const char * map, char * escapes) /* [HGM] moved here from winboard.c because of its general usefulness */ /* Basically a safe strcpy that uses the last character as King */ { - int result = FALSE; int NrPieces; + int result = FALSE; int NrPieces, offs; if( map != NULL && (NrPieces=ptclen(map, escapes)) <= (int) EmptySquare && NrPieces >= 12 && !(NrPieces&1)) { int i, j = 0; /* [HGM] Accept even length from 12 to 88 */ for( i=0; i<(int) EmptySquare; i++ ) table[i] = '.'; - for( i=0; i