]> git.sesse.net Git - bursty/blobdiff - truncate-end.pl
Add a small script to deal with the fact that we might not have the entire receiver...
[bursty] / truncate-end.pl
diff --git a/truncate-end.pl b/truncate-end.pl
new file mode 100755 (executable)
index 0000000..4975426
--- /dev/null
@@ -0,0 +1,17 @@
+#! /usr/bin/perl
+
+use strict;
+use warnings;
+
+my @buffer = ();
+
+while (<>) {
+       chomp;
+       if (/\d /) {
+               print join("\n", @buffer);
+               @buffer = ();
+               print "$_\n";
+       } else {
+               push @buffer, $_;
+       }
+}