--- ghostscript-9.06/base/gsicc_manage.c.0028~ 2012-08-08 10:01:36.000000000 +0200 +++ ghostscript-9.06/base/gsicc_manage.c 2012-08-12 19:20:56.447641534 +0200 @@ -18,6 +18,7 @@ #include "std.h" #include "stdpre.h" #include "gstypes.h" +#include "gxiodev.h" #include "gsmemory.h" #include "gsstruct.h" #include "scommon.h" @@ -2163,6 +2164,8 @@ gs_setdefaultgrayicc(const gs_state * pg return code; } +extern_gx_io_device_table(); + void gs_currenticcdirectory(const gs_state * pgs, gs_param_string * pval) { @@ -2170,8 +2173,19 @@ gs_currenticcdirectory(const gs_state * const gs_lib_ctx_t *lib_ctx = pgs->memory->gs_lib_ctx; if (lib_ctx->profiledir == NULL) { - pval->data = (const byte *)rfs; - pval->size = strlen(rfs); + int have_rom_device = 0; + int i; + for(i = 0; i < gx_io_device_table_count; i++) { + const gx_io_device *iodev = gx_io_device_table[i]; + const char *dname = iodev->dname; + + if (dname && strlen(dname) == 5 && !memcpy("%rom%", dname, 5)) { + have_rom_device = 1; + break; + } + } + pval->data = (const byte *) (have_rom_device ? rfs : ""); + pval->size = strlen(pval->data); pval->persistent = true; } else { pval->data = (const byte *)(lib_ctx->profiledir);