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 b546589..63cdac2 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;
        }