summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2021-08-05 14:08:11 -0700
committerRay Johnston <ray.johnston@artifex.com>2021-08-05 14:08:11 -0700
commit2a63e973f16029536efa12dfbd251cb03011ee57 (patch)
tree44162a27e985f2ce81a51a762f08660a6450f865 /lib
parent2e705321bee5afae75ffcc4b71ba7643ded1d5e8 (diff)
downloadghostpdl-2a63e973f16029536efa12dfbd251cb03011ee57.tar.gz
Fix gslp.ps -c to handle No EOL case.
The "Truncate" flag handling did not work with a line with no EOL.
Diffstat (limited to 'lib')
-rw-r--r--lib/gslp.ps37
1 files changed, 19 insertions, 18 deletions
diff --git a/lib/gslp.ps b/lib/gslp.ps
index d9598fd91..9a3a2f3e6 100644
--- a/lib/gslp.ps
+++ b/lib/gslp.ps
@@ -287,14 +287,17 @@ lpdict begin
/StringTAB (\t) def
/CharTAB StringTAB 0 get def
-/showline % line -> leftover_line (handles \f)
- { { showline1 dup length 0 eq { exit } if
- dup 0 get CharFF ne { exit } if
+/showline { % line -> leftover_line (handles \f)
+ { showline1 dup length 0 eq { exit } if
+ dup 0 get CharFF ne {
+ Truncate { pop () } if
+ exit
+ } if
EjectFF { endpage beginpage } { endcolumn } ifelse
skip1
- }
+ }
loop
- } def
+} def
/showline1 % line -> leftover_line (handles page break)
{ lindex llength eq { endpage beginpage } if
@@ -527,24 +530,22 @@ lpdict begin
pop pop % done
} if
} if
- { dup length /pos exch def
- lbuf exch 0 exch putinterval
- { lpfile lbuf pos lbuf length pos sub getinterval readline } stopped
- { % Filled the line before a CR or EOF.
- exch pop showline
- }
- { % Reached CR and/or EOF first.
+ { dup length /pos exch def
+ lbuf exch 0 exch putinterval
+ { lpfile lbuf pos lbuf length pos sub getinterval readline } stopped
+ { % Filled the line before a CR or EOF.
+ exch pop showline
+ }
+ { % Reached CR and/or EOF first.
exch length pos add lbuf exch 0 exch getinterval
1 index { showline } if % omit final empty line
- { dup length 0 eq Truncate or { pop () exit } if
+ { dup length 0 eq { pop () exit } if
showline
- }
- loop
+ } loop
exch not { exit } if
- }
- ifelse
+ } ifelse
pindex PageLast gt { exit } if
- } loop
+ } loop
pop
% Wrap up.