Updated copyright notice to 2011
[xboard.git] / parser.l
index 061d6ca..392b5b2 100644 (file)
--- a/parser.l
+++ b/parser.l
@@ -12,7 +12,7 @@
  * Massachusetts.
  *
  * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005,
- * 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ * 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
  *
  * The following terms apply to Digital Equipment Corporation's copyright
  * interest in XBoard:
@@ -845,6 +845,8 @@ extern void CopyBoard P((Board to, Board from));
     } else {
        currentMoveString[0] = ToLower(yytext[0]);
     }
+    if(CharToPiece(currentMoveString[0]) == EmptySquare) return ImpossibleMove; // Unknown piece;
+
     return LegalityTest(boards[yyboardindex], PosFlags(yyboardindex), DROP_RANK, // [HGM] does drops now too
                         CharToPiece(currentMoveString[0]), currentMoveString[3] - ONE, currentMoveString[2] - AAA, NULLCHAR);
 }