From 32b1501b1e026d85b8d50b4a923424eeeed230e2 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Fri, 2 Jan 1998 04:26:39 +0000 Subject: fix up perl script so it is a little cleaner and also works with perl 4 (This used to be commit 5b724c6551c963454fe4ce27cfc8756e0c76712d) --- packaging/SGI/psfixes.pl | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'packaging/SGI/psfixes.pl') 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; } - } } -- cgit