mjg / rpms / ghostscript

Forked from rpms/ghostscript 4 years ago
Clone
2982191
diff -up ghostscript-9.04rc1/psi/zusparam.c.iccprofiles-initdir ghostscript-9.04rc1/psi/zusparam.c
2982191
--- ghostscript-9.04rc1/psi/zusparam.c.iccprofiles-initdir	2011-07-29 10:42:52.000000000 +0100
2982191
+++ ghostscript-9.04rc1/psi/zusparam.c	2011-08-01 12:32:41.203228412 +0100
2982191
@@ -605,6 +605,8 @@ set_default_gray_icc(i_ctx_t *i_ctx_p, g
1a1240e
     return code;
9930de3
 }
9930de3
 
9930de3
+extern_gx_io_device_table();
9930de3
+
9930de3
 static void
9930de3
 current_icc_directory(i_ctx_t *i_ctx_p, gs_param_string * pval)
9930de3
 {
2982191
@@ -612,8 +614,21 @@ current_icc_directory(i_ctx_t *i_ctx_p, 
2982191
     const gs_lib_ctx_t *lib_ctx = ((gs_imager_state *)igs)->memory->gs_lib_ctx;
2982191
 
2982191
     if (lib_ctx->profiledir == NULL) {
2982191
-        pval->data = (const byte *)rfs;
2982191
-        pval->size = strlen(rfs);
2982191
+	int have_rom_device = 0;
2982191
+	int i;
9930de3
+
2982191
+	for (i = 0; i < gx_io_device_table_count; i++) {
2982191
+	    const gx_io_device *iodev = gx_io_device_table[i];
2982191
+	    const char *dname = iodev->dname;
9930de3
+
2982191
+	    if (dname && strlen(dname) == 5 && !memcpy("%rom%", dname, 5)) {
2982191
+		have_rom_device = 1;
2982191
+		break;
2982191
+	    }
2982191
+	}
2982191
+
2982191
+        pval->data = (const byte *) (have_rom_device ? rfs : "");
2982191
+        pval->size = strlen(pval->data);
2982191
     } else {
2982191
         pval->data = (const byte *)(lib_ctx->profiledir);
2982191
         pval->size = lib_ctx->profiledir_len;