Decapitalize promoChar in move parser
[xboard.git] / parser.c
index c4330d1..6200d0f 100644 (file)
--- 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 &&