git@sv
/
enscript.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Updating the ChangeLog file
[enscript.git]
/
docs
/
clean-nroff.pl
1
#!/usr/local/bin/perl -w
2
3
sub skip_lines {
4
($count) = @_;
5
6
while ($count > 0) {
7
if (!<>) {
8
last;
9
}
10
$count--;
11
}
12
if ($count > 0) {
13
return 0;
14
}
15
return 1;
16
}
17
18
sub print_lines {
19
($count) = @_;
20
21
while ($count > 0) {
22
$line = <>;
23
if (!$line) {
24
last;
25
}
26
print $line;
27
$count--;
28
}
29
30
if ($count > 0) {
31
return 0;
32
}
33
return 1;
34
}
35
36
# Header.
37
print_lines(7);
38
39
# Process file.
40
while (1) {
41
if (!print_lines(52) || !skip_lines(14)) {
42
last;
43
}
44
}