X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=parser.c;h=6da13d40b7c73700ee52e2de2dabbe149e928ed4;hb=c68f0cbbb5f80637e75c26b1046f56c03be98290;hp=e0b4ff44c035e06555594b77203fdd2444ec4d95;hpb=30ded7c1180da9dc3dc703d92f4c0617ea092647;p=xboard.git diff --git a/parser.c b/parser.c index e0b4ff4..6da13d4 100644 --- a/parser.c +++ b/parser.c @@ -353,7 +353,7 @@ badMove:// we failed to find algebraic move } // ********* SAN Castings ************************************* - if(**p == 'O' || **p == 'o' || **p == '0') { + if(**p == 'O' || **p == 'o' || **p == '0' && !Match("00:", p)) { // exclude 00 in time stamps int castlingType = 0; if(Match("O-O-O", p) || Match("o-o-o", p) || Match("0-0-0", p) || Match("OOO", p) || Match("ooo", p) || Match("000", p)) castlingType = 2; @@ -532,6 +532,8 @@ badMove:// we failed to find algebraic move return Nothing; } + // ********* Prevent 00 in unprotected time stamps to be mistaken for castling ******* + if(Match(":00", p)) return Nothing; // ********* Could not match to anything. Return offending character **** (*p)++;