summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2021-06-25 19:37:24 -0700
committerRay Johnston <ray.johnston@artifex.com>2021-06-25 19:37:24 -0700
commit50db12bd12f76058516d5c44b5ba7b4c4cf96651 (patch)
treef6cb2473166dfe421dc48622c7aa2bd46398293a /lib
parent65e5a72c5154859a10e612e9efa93810f705d4d5 (diff)
downloadghostpdl-50db12bd12f76058516d5c44b5ba7b4c4cf96651.tar.gz
Fix --detect mode in gslp.ps to handle new-lines in first two characters
Reported by customer 193
Diffstat (limited to 'lib')
-rw-r--r--lib/gslp.ps9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/gslp.ps b/lib/gslp.ps
index 173d52c21..a0a1808ee 100644
--- a/lib/gslp.ps
+++ b/lib/gslp.ps
@@ -506,6 +506,15 @@ lpdict begin
% Iterate through the file.
lpline
+ % First handle new-lines in the initial string (--detect mode)
+ (\n) search {
+ showline % output up to the first new-line
+ pop pop % done with that string and the new-line
+ (\n) search {
+ showline % output the second new-line
+ 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