parse-contents: Fix display of progress
authorFrank Lichtenheld <frank@lichtenheld.de>
Mon, 8 Oct 2007 01:37:54 +0000 (03:37 +0200)
committerFrank Lichtenheld <frank@lichtenheld.de>
Mon, 8 Oct 2007 01:37:54 +0000 (03:37 +0200)
Files without header did confuse the line numbers

bin/parse-contents

index 414dc8ac0a623c1f11e04154423881f033478cc7..b8cc8e4158a2b7cffb1566f09d674ac7f560796d 100755 (executable)
@@ -82,8 +82,11 @@ for my $suite (@suites) {
                
                open CONT, "zcat $filename|$what"
                    or die $!;
-               while (<CONT>) {last if /^FILE/mo;}
-               open CONT, "zcat $filename|$what" if eof(CONT);
+               while (<CONT>) { last if /^FILE/mo; }
+               if (eof(CONT)) { # no header found
+                   close CONT; # explicit close to reset $.
+                   open CONT, "zcat $filename|$what";
+               }
                while (<CONT>) {
                    my $data = "";
                    my %data = ();