[packages/perl-Time-TAI64] print not tai64 lines unaltered

glen glen at pld-linux.org
Thu Aug 2 13:20:45 CEST 2012


commit 7209501c84a3fee3b99e30219ccbed9ddad4eac4
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Aug 2 14:20:40 2012 +0300

    print not tai64 lines unaltered

 tai64nd.pl | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/tai64nd.pl b/tai64nd.pl
index 5026213..5a8b652 100755
--- a/tai64nd.pl
+++ b/tai64nd.pl
@@ -12,6 +12,10 @@ my ($last, $tai, $log, $t, $diff);
 while (my $line = <>) {
 	($tai, $log) = split(' ', $line, 2);
 	$t = tai64nunix($tai);
+
+	# skip not tai64 formatted line
+	print $line and next unless $t;
+
 	$diff = $last ? $t - $last : 0;
 	printf "%s [+%.4f] %s", tai64nlocal($tai), $diff, $log;
 	$last = $t;


More information about the pld-cvs-commit mailing list