]> git.sesse.net Git - remoteglot/commitdiff
Remove first names from PGNs.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Mar 2016 17:05:10 +0000 (18:05 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Mar 2016 17:05:10 +0000 (18:05 +0100)
remoteglot.pl

index b466d4dc2721c48126f0253ec3f6838e318c40f1..b75d85e1961621c1fb5334242c1ac64ca052bc4e 100755 (executable)
@@ -291,7 +291,11 @@ sub handle_pgn {
                        }
 
                        $pgn->parse_game({ save_comments => 'yes' });
-                       my $pos = Position->start_pos($pgn->white, $pgn->black);
+                       my $white = $pgn->white;
+                       my $black = $pgn->black;
+                       $white =~ s/,.*//;  # Remove first name.
+                       $black =~ s/,.*//;  # Remove first name.
+                       my $pos = Position->start_pos($white, $black);
                        my $moves = $pgn->moves;
                        my @uci_moves = ();
                        my @repretty_moves = ();