DroidFish: Ignore leading and trailing whitespace when parsing FEN strings.

This commit is contained in:
Peter Osterlund
2015-01-25 01:04:57 +00:00
parent 9e5c22e607
commit fffd5107c3

View File

@@ -45,6 +45,7 @@ public class TextIO {
/** Parse a FEN string and return a chess Position object. */
public static final Position readFEN(String fen) throws ChessParseError {
fen = fen.trim();
Position pos = new Position();
String[] words = fen.split(" ");
if (words.length < 2) {