summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>1998-01-02 04:26:39 +0000
committerHerb Lewis <herb@samba.org>1998-01-02 04:26:39 +0000
commit5b724c6551c963454fe4ce27cfc8756e0c76712d (patch)
treeb526cc86e54d5baae37a9d76d5ac89dc00b0f90d /packaging
parent52e275c4ccc1b7f0c2ef8d12d28065898a1c89c9 (diff)
downloadsamba-5b724c6551c963454fe4ce27cfc8756e0c76712d.tar.gz
samba-5b724c6551c963454fe4ce27cfc8756e0c76712d.tar.xz
samba-5b724c6551c963454fe4ce27cfc8756e0c76712d.zip
fix up perl script so it is a little cleaner and also works with perl 4
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/SGI/psfixes.pl38
1 files changed, 21 insertions, 17 deletions
diff --git a/packaging/SGI/psfixes.pl b/packaging/SGI/psfixes.pl
index 4ed9e16f7ec..c5269b9142e 100755
--- a/packaging/SGI/psfixes.pl
+++ b/packaging/SGI/psfixes.pl
@@ -1,26 +1,30 @@
#!/usr/bin/perl
-$found_vm = 0;
-
while (<>) {
- if (not $found_vm) {
- if (not /^%/) {
- if (/^%%Title:/) {
- s/. $/ /;
+# strip any ctrl-d's
+ $_ =~ s/^//;
+# get rid of any non-postscript commands
+ if (/^%/) {
+ do {
+ $_ = <>;
+ } until ( /^%/ ) || eof() ;
+ if (! eof()) {
print;
}
- elsif (/^\/VM?/) {
- print "/VM? { pop } bind def \n";
- $found_vm = 1;
- }
- else {
+ }
+# fix bug in long titles from MS Word
+ elsif (/^%%Title:/) {
+ s/. $/ /;
print;
- }
}
- }
- else {
- if (/def /) {
- $found_vm = 0;
+# remove VM test
+ elsif (/^\/VM?/) {
+ print "/VM? { pop } bind def \n";
+ do {
+ $_ = <>;
+ } until (/def /) || eof() ;
+ }
+ else {
+ print;
}
- }
}