X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXUtil.pm;h=d23cb92ea7daa952d57c1deacaa843aa6b329f19;hb=2747e0fe4269e9a7e095c333598191eb9dca63fc;hp=e77eb2947d80f8db249dc109c984ff070243b8cf;hpb=d40358b98c4f3fe24890369543dd7768c99da962;p=spider.git diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index e77eb294..d23cb92e 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -383,10 +383,10 @@ sub unpad sub is_callsign { return $_[0] =~ m!^ - (?:\d?[A-Z]{1,2}\d*/)? # out of area prefix / - (?:\d?[A-Z]{1,2}\d+) # main prefix one (required) + (?:\d?[A-Z]{1,2}\d{0,2}/)? # out of area prefix / + (?:\d?[A-Z]{1,2}\d{1,5}) # main prefix one (required) - lengthened for special calls [A-Z]{1,5} # callsign letters (required) - (?:-(?:\d{1,2}|\#))? # - nn possibly (eg G8BPQ-8) or -# (an RBN spot) + (?:-(?:\d{1,2}))? # - nn possibly (eg G8BPQ-8) (?:/[0-9A-Z]{1,7})? # / another prefix, callsign or special label (including /MM, /P as well as /EURO or /LGT) possibly $!x; @@ -554,15 +554,14 @@ sub difft $t -= $d * 86400; $h = int $t / 3600; $out .= sprintf ("%s${h}h", $adds?' ':'') if $h; -# $out .= "${h}h" if $h || $d; $t -= $h * 3600; $m = int $t / 60; $out .= sprintf ("%s${m}m", $adds?' ':'') if $m; -# $out .= "${m}m" if $m || $h || $d; - $s = int $t % 60; - $out .= sprintf ("%s${s}s", $adds?' ':'') if $s; - # $out .= "${s}s"; - $out ||= sprintf ("%s0s", $adds?' ':''); + if ($d == 0 && $adds || $adds == 2) { + $s = int $t % 60; + $out .= sprintf ("%s${s}s", $adds?' ':'') if $s; + $out ||= sprintf ("%s0s", $adds?' ':''); + } return $out; }