From: Steinar H. Gunderson Date: Mon, 11 May 2015 18:15:23 +0000 (+0200) Subject: Be more flexible about clk comments. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=5db695ca7d5f0df1cbf6592f2cc48ca020926020 Be more flexible about clk comments. --- diff --git a/remoteglot.pl b/remoteglot.pl index 6d07c5b..9c2130c 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -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; }