Blame SOURCES/ghostscript-iccprofiles-initdir.patch

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