ghostscript/ghostscript-runlibfileifexists.patch

53 lines
2.3 KiB
Diff
Raw Normal View History

2012-08-09 13:30:22 +00:00
diff -up ghostscript-9.06/Resource/Init/gs_fonts.ps.runlibfileifexists ghostscript-9.06/Resource/Init/gs_fonts.ps
--- ghostscript-9.06/Resource/Init/gs_fonts.ps.runlibfileifexists 2012-08-08 09:01:36.000000000 +0100
+++ ghostscript-9.06/Resource/Init/gs_fonts.ps 2012-08-09 08:23:46.750732348 +0100
@@ -95,10 +95,19 @@ userdict /Fontmap .FontDirectory maxleng
% stack: dict file fontname filename|aliasname
1 index type /stringtype eq
1 index type /nametype eq and 1 index xcheck and
- 1 index /run eq 2 index /.runlibfile eq or and {
+ 1 index /run eq 2 index /.runlibfile eq 3 index /.runlibfileifexists eq or or and {
% This is an inclusion entry.
- pop findlibfile { exch pop } { file } ifelse
- 2 index exch .readFontmap pop
+ 0 index /.runlibfileifexists eq {
+ pop findlibfile {
+ exch pop
+ 2 index exch .readFontmap pop
+ } {
+ pop
+ } ifelse
+ } {
+ pop findlibfile { exch pop } { file } ifelse
+ 2 index exch .readFontmap pop
+ } ifelse
} {
% This is a real entry.
% Read and pop tokens until a semicolon.
2012-08-09 13:30:22 +00:00
diff -up ghostscript-9.06/Resource/Init/gs_init.ps.runlibfileifexists ghostscript-9.06/Resource/Init/gs_init.ps
--- ghostscript-9.06/Resource/Init/gs_init.ps.runlibfileifexists 2012-08-08 09:01:36.000000000 +0100
+++ ghostscript-9.06/Resource/Init/gs_init.ps 2012-08-09 08:23:46.750732348 +0100
@@ -678,6 +678,14 @@ systemdict /internaldict dup .makeintern
2011-08-09 14:42:00 +00:00
{ /undefinedfilename signalerror }
ifelse
} bind def
+/runlibfileifexists
2011-08-09 14:42:00 +00:00
+ { % We don't want to bind 'run' into this procedure,
+ % since run may get redefined.
+ findlibfile
+ { exch pop /run .systemvar exec }
+ { pop }
+ ifelse
+ } bind def
/selectdevice
2011-08-09 14:42:00 +00:00
{ finddevice setdevice .setdefaultscreen } bind def
/signalerror % <object> <errorname> signalerror -
2012-08-09 13:30:22 +00:00
@@ -846,6 +854,7 @@ userdict /.currentresourcefile //null pu
2011-08-09 14:42:00 +00:00
} bind def
% Temporarily substitute it for the real runlibfile.
/.runlibfile /runlibfile load def
2007-11-30 11:01:37 +00:00
+/.runlibfileifexists /runlibfileifexists load def
/runlibfile /runlibfile0 load def
% Create the error handling machinery.