Fix some corruption issues in truncate-end.pl.
[bursty] / truncate-end.pl
1 #! /usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 my @buffer = ();
7
8 while (<>) {
9         chomp;
10         if (/\d / && !/\*/) {
11                 if (scalar @buffer > 0) {
12                         print join("\n", @buffer), "\n";
13                         @buffer = ();
14                 }
15                 print "$_\n";
16         } else {
17                 push @buffer, $_;
18         }
19 }