diff -up ghostscript-9.15/Resource/Init/gs_fonts.ps.runlibfileifexists ghostscript-9.15/Resource/Init/gs_fonts.ps --- ghostscript-9.15/Resource/Init/gs_fonts.ps.runlibfileifexists 2014-09-22 11:17:33.000000000 +0100 +++ ghostscript-9.15/Resource/Init/gs_fonts.ps 2014-09-23 09:45:44.029511858 +0100 @@ -109,10 +109,19 @@ userdict /Fontmap .FontDirectory maxleng } if 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. diff -up ghostscript-9.15/Resource/Init/gs_init.ps.runlibfileifexists ghostscript-9.15/Resource/Init/gs_init.ps --- ghostscript-9.15/Resource/Init/gs_init.ps.runlibfileifexists 2014-09-22 11:17:33.000000000 +0100 +++ ghostscript-9.15/Resource/Init/gs_init.ps 2014-09-23 09:45:44.030511863 +0100 @@ -894,6 +894,14 @@ systemdict /internaldict dup .makeintern { /undefinedfilename signalerror } ifelse } .internalbind def +/runlibfileifexists + { % We don't want to bind 'run' into this procedure, + % since run may get redefined. + findlibfile + { exch pop /run .systemvar exec } + { pop } + ifelse + } .internalbind def /selectdevice { finddevice setdevice .setdefaultscreen } .internalbind odef /signalerror % signalerror - @@ -852,6 +860,7 @@ userdict /.currentresourcefile //null pu } .internalbind def % Temporarily substitute it for the real runlibfile. /.runlibfile /runlibfile load def +/.runlibfileifexists /runlibfileifexists load def /runlibfile //runlibfile0 def currentdict /runlibfile0 .undef