mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-12-01 14:04:18 +08:00
9d564f73f5
Makefile.in (depend): Make "make depend" at the top-level automatically recurse through all subdirectories. configure.in: Test for perl since it's needed by wordwrap.pl MCONFIG.in (depend): Fix make-depend so that it the dependencies are automatically word-wrapped. Added the makefile macro $(PERL). wordwrap.pl: New file which does the word wrapping.
27 lines
446 B
Perl
27 lines
446 B
Perl
#!/usr/bin/perl
|
|
#
|
|
# wordwrap.pl --- does word wrap
|
|
#
|
|
while (<>) {
|
|
if (/^#/) { # don't word wrap comments
|
|
print;
|
|
next;
|
|
}
|
|
next if (/^$/); # skip blank lines
|
|
$linelen = 0;
|
|
split;
|
|
while (defined($word = shift @_)) {
|
|
if ($linelen > 0) {
|
|
printf(" ");
|
|
}
|
|
$len = length($word) + 1;
|
|
$linelen += $len;
|
|
if ($linelen > 78) {
|
|
printf("\\\n ");
|
|
$linelen = 1+$len;
|
|
}
|
|
printf("%s", $word);
|
|
}
|
|
printf("\n");
|
|
}
|