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 4975426..4f8a5d5 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, $_;