Deal with strange PGN download failures.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 23 Nov 2014 13:44:28 +0000 (14:44 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 23 Nov 2014 13:44:28 +0000 (14:44 +0100)
remoteglot.pl

index 63cdac2..917a6a0 100755 (executable)
@@ -268,7 +268,7 @@ sub handle_pgn {
        }
 
        my $pgn = Chess::PGN::Parse->new(undef, $body);
-       if (!defined($pgn) || !$pgn->read_game()) {
+       if (!defined($pgn) || !$pgn->read_game() || $body !~ /^\[/) {
                warn "Error in parsing PGN from $url\n";
        } else {
                eval {