mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
fix up perl script so it is a little cleaner and also works with perl 4
(This used to be commit 5b724c6551c963454fe4ce27cfc8756e0c76712d)
This commit is contained in:
parent
0a5073e985
commit
32b1501b1e
@ -1,26 +1,30 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
$found_vm = 0;
|
||||
|
||||
while (<>) {
|
||||
if (not $found_vm) {
|
||||
if (not /^%/) {
|
||||
if (/^%%Title:/) {
|
||||
# strip any ctrl-d's
|
||||
$_ =~ s/^//;
|
||||
# get rid of any non-postscript commands
|
||||
if (/^%/) {
|
||||
do {
|
||||
$_ = <>;
|
||||
} until ( /^%/ ) || eof() ;
|
||||
if (! eof()) {
|
||||
print;
|
||||
}
|
||||
}
|
||||
# fix bug in long titles from MS Word
|
||||
elsif (/^%%Title:/) {
|
||||
s/.
$/
/;
|
||||
print;
|
||||
}
|
||||
elsif (/^\/VM?/) {
|
||||
print "/VM? { pop } bind def
\n";
|
||||
$found_vm = 1;
|
||||
}
|
||||
else {
|
||||
print;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (/def
/) {
|
||||
$found_vm = 0;
|
||||
# remove VM test
|
||||
elsif (/^\/VM?/) {
|
||||
print "/VM? { pop } bind def
\n";
|
||||
do {
|
||||
$_ = <>;
|
||||
} until (/def
/) || eof() ;
|
||||
}
|
||||
else {
|
||||
print;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user