summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 4ed9e16f7e..c5269b9142 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;
}
- }
}