From 5db695ca7d5f0df1cbf6592f2cc48ca020926020 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 11 May 2015 20:15:23 +0200 Subject: [PATCH] Be more flexible about clk comments. --- remoteglot.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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; } -- 2.39.2