Blame SOURCES/ghostscript-iccprofiles-initdir.patch

c9d7fc
diff -up ghostscript-9.06/base/gsicc_manage.c.iccprofiles-initdir ghostscript-9.06/base/gsicc_manage.c
c9d7fc
--- ghostscript-9.06/base/gsicc_manage.c.iccprofiles-initdir	2012-08-09 13:58:22.102364807 +0100
c9d7fc
+++ ghostscript-9.06/base/gsicc_manage.c	2012-08-09 14:09:24.495864641 +0100
c9d7fc
@@ -38,6 +38,7 @@
c9d7fc
 #include "gsicc_create.h"
c9d7fc
 #include "gpmisc.h"
c9d7fc
 #include "gxdevice.h"
c9d7fc
+#include "gxiodev.h"
c9d7fc
 
c9d7fc
 #define ICC_HEADER_SIZE 128
c9d7fc
 
c9d7fc
@@ -2176,8 +2177,21 @@ gs_currenticcdirectory(const gs_state *
c9d7fc
     const gs_lib_ctx_t *lib_ctx = pgs->memory->gs_lib_ctx;
c9d7fc
 
c9d7fc
     if (lib_ctx->profiledir == NULL) {
c9d7fc
-        pval->data = (const byte *)rfs;
c9d7fc
-        pval->size = strlen(rfs);
c9d7fc
+	int have_rom_device = 0;
c9d7fc
+	int i;
c9d7fc
+
c9d7fc
+	for (i = 0; i < gx_io_device_table_count; i++) {
c9d7fc
+	    const gx_io_device *iodev = lib_ctx->io_device_table[i];
c9d7fc
+	    const char *dname = iodev->dname;
c9d7fc
+
c9d7fc
+	    if (dname && strlen(dname) == 5 && !memcmp("%rom%", dname, 5)) {
c9d7fc
+		have_rom_device = 1;
c9d7fc
+		break;
c9d7fc
+	    }
c9d7fc
+	}
c9d7fc
+
c9d7fc
+        pval->data = (const byte *)(have_rom_device ? rfs : "");
c9d7fc
+        pval->size = strlen((const char *)pval->data);
c9d7fc
         pval->persistent = true;
c9d7fc
     } else {
c9d7fc
         pval->data = (const byte *)(lib_ctx->profiledir);