]> git.sesse.net Git - bursty/commitdiff
Fix some corruption issues in truncate-end.pl. master
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 28 May 2012 14:41:25 +0000 (16:41 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 28 May 2012 14:41:25 +0000 (16:41 +0200)
truncate-end.pl

index 4975426f053312f2c5654e9ee255b934fb36107c..4f8a5d55041659cd2cafdada39d96282fcd73e34 100755 (executable)
@@ -7,9 +7,11 @@ my @buffer = ();
 
 while (<>) {
        chomp;
-       if (/\d /) {
-               print join("\n", @buffer);
-               @buffer = ();
+       if (/\d / && !/\*/) {
+               if (scalar @buffer > 0) {
+                       print join("\n", @buffer), "\n";
+                       @buffer = ();
+               }
                print "$_\n";
        } else {
                push @buffer, $_;