1999-07-04 04:25:58 +08:00
|
|
|
#!/usr/bin/perl
|
|
|
|
#
|
|
|
|
# wordwrap.pl --- does word wrap
|
|
|
|
#
|
|
|
|
while (<>) {
|
|
|
|
if (/^#/) { # don't word wrap comments
|
|
|
|
print;
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
next if (/^$/); # skip blank lines
|
|
|
|
$linelen = 0;
|
2012-09-22 00:31:13 +08:00
|
|
|
@words = split;
|
|
|
|
while (defined($word = shift @words)) {
|
2001-06-02 07:49:46 +08:00
|
|
|
$word =~ s#\$\(srcdir\)/\.\./version.h#\$\(top_srcdir\)/version.h#;
|
|
|
|
$word =~ s#\$\(srcdir\)/.\.\/\.\./version.h#\$\(top_srcdir\)/version.h#;
|
|
|
|
$word =~ s#\$\(srcdir\)/.\.\/et/com_err.h#\$\(top_srcdir\)/lib/et/com_err.h#;
|
1999-07-04 04:25:58 +08:00
|
|
|
if ($linelen > 0) {
|
|
|
|
printf(" ");
|
|
|
|
}
|
|
|
|
$len = length($word) + 1;
|
|
|
|
$linelen += $len;
|
|
|
|
if ($linelen > 78) {
|
|
|
|
printf("\\\n ");
|
|
|
|
$linelen = 1+$len;
|
|
|
|
}
|
|
|
|
printf("%s", $word);
|
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
}
|