]> git.sesse.net Git - remoteglot/commitdiff
Be more flexible about clk comments.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 11 May 2015 18:15:23 +0000 (20:15 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 11 May 2015 18:15:23 +0000 (20:15 +0200)
remoteglot.pl

index 6d07c5bd6049d773e2da54633d215bd5b9784000..9c2130cc55fca075cb853c0904614d322a7fd3e3 100755 (executable)
@@ -1009,12 +1009,15 @@ sub extract_clock {
 
        if (exists($comments->{$white_key}) &&
            exists($comments->{$black_key}) &&
-           $comments->{$white_key} =~ /tl=(\d+:\d+:\d+)/ &&
-           $comments->{$black_key} =~ /tl=(\d+:\d+:\d+)/) {
-               $comments->{$white_key} =~ /tl=(\d+:\d+:\d+)/;
+           $comments->{$white_key} =~ /(?:tl=|clk )(\d+:\d+:\d+)/ &&
+           $comments->{$black_key} =~ /(?:tl=|clk )(\d+:\d+:\d+)/) {
+               $comments->{$white_key} =~ /(?:tl=|clk )(\d+:\d+:\d+)/;
                $pos->{'white_clock'} = $1;
-               $comments->{$black_key} =~ /tl=(\d+:\d+:\d+)/;
+               $comments->{$black_key} =~ /(?:tl=|clk )(\d+:\d+:\d+)/;
                $pos->{'black_clock'} = $1;
+
+               $pos->{'white_clock'} =~ s/\b(\d)\b/0$1/g;
+               $pos->{'black_clock'} =~ s/\b(\d)\b/0$1/g;
                return;
        }