X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=parser.c;h=6200d0f24bf65e9c4aa20fc26f2c834c14f90c2e;hb=003ab519c36430f6df51e0e6e2aa528476894161;hp=c4330d12dd9aecf188f173d233c8fe52ccfdd34b;hpb=4e062d14429ed3a3a251c971690bade4c8cba946;p=xboard.git diff --git a/parser.c b/parser.c index c4330d1..6200d0f 100644 --- a/parser.c +++ b/parser.c @@ -153,8 +153,8 @@ PromoSuffix (char **p) if(**p == 'e' && (Match("ep", p) || Match("e.p.", p))) { *p = start; return NULLCHAR; } // non-compliant e.p. suffix is no promoChar! if(**p == '+' && gameInfo.variant == VariantShogi) { (*p)++; return '+'; } if(**p == '=' || (gameInfo.variant == VariantSChess) && **p == '/') (*p)++; // optional = (or / for Seirawan gating) - if(**p == '(' && (*p)[2] == ')' && isalpha( (*p)[1] )) { (*p) += 3; return (*p)[-2]; } - if(isalpha(**p)) return *(*p)++; + if(**p == '(' && (*p)[2] == ')' && isalpha( (*p)[1] )) { (*p) += 3; return ToLower((*p)[-2]); } + if(isalpha(**p)) return ToLower(*(*p)++); if(*p != start) return '='; // must be the optional = return NULLCHAR; // no suffix detected } @@ -220,7 +220,6 @@ NextUnit (char **p) type[1] = NOTHING; // disambiguator goes in first two positions n = 4; } -if(appData.debugMode)fprintf(debugFP, "trial %d,%d,%d,%d type %d%d%d%d\n", coord[0], coord[1], coord[2], coord[3], type[0], type[1], type[2], type[3]); // we always get here; move must be completely read now, with to-square coord(s) at end if(n == 3) { // incomplete to-square. Could be Xiangqi traditional, or stuff like fxg if(piece && type[1] == NOTHING && type[0] == NUMERIC && type[2] == NUMERIC &&