]> git.sesse.net Git - remoteglot/commitdiff
Deal with inconsistent zero padding in PGN clocks.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 23 Nov 2014 12:02:46 +0000 (13:02 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 23 Nov 2014 12:02:46 +0000 (13:02 +0100)
remoteglot.pl

index b546589e5c03bfb56e9fd69caa3b6a13a996b075..63cdac205d89a57e036e12b59d604212e0cbfbba 100755 (executable)
@@ -983,6 +983,9 @@ sub extract_clock {
        if (exists($tags->{'WhiteClock'}) && exists($tags->{'BlackClock'})) {
                $pos->{'white_clock'} = $tags->{'WhiteClock'};
                $pos->{'black_clock'} = $tags->{'BlackClock'};
+
+               $pos->{'white_clock'} =~ s/\b(\d)\b/0$1/g;
+               $pos->{'black_clock'} =~ s/\b(\d)\b/0$1/g;
                return;
        }