blob: 807c62888af59c561f23279edee8dc1a60015f51 [file] [log] [blame]
Theodore Ts'o9d564f71999-07-03 20:25:58 +00001#!/usr/bin/perl
2#
3# wordwrap.pl --- does word wrap
4#
5while (<>) {
6 if (/^#/) { # don't word wrap comments
7 print;
8 next;
9 }
10 next if (/^$/); # skip blank lines
11 $linelen = 0;
JP Abgralle0ed7402014-03-19 19:08:39 -070012 @words = split;
13 while (defined($word = shift @words)) {
Theodore Ts'o797f5ef2001-06-01 23:49:46 +000014 $word =~ s#\$\(srcdir\)/\.\./version.h#\$\(top_srcdir\)/version.h#;
15 $word =~ s#\$\(srcdir\)/.\.\/\.\./version.h#\$\(top_srcdir\)/version.h#;
16 $word =~ s#\$\(srcdir\)/.\.\/et/com_err.h#\$\(top_srcdir\)/lib/et/com_err.h#;
Theodore Ts'o9d564f71999-07-03 20:25:58 +000017 if ($linelen > 0) {
18 printf(" ");
19 }
20 $len = length($word) + 1;
21 $linelen += $len;
22 if ($linelen > 78) {
23 printf("\\\n ");
24 $linelen = 1+$len;
25 }
26 printf("%s", $word);
27 }
28 printf("\n");
29}