Magellan Linux

Annotation of /trunk/ghostscript-gpl/patches/ghostscript-gpl-9.04-iccprofiles-initdir.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1570 - (hide annotations) (download)
Thu Nov 24 19:57:41 2011 UTC (12 years, 5 months ago) by niro
File size: 1263 byte(s)
-rediffed
1 niro 1570 diff -up ghostscript-9.04rc1/psi/zusparam.c.iccprofiles-initdir ghostscript-9.04rc1/psi/zusparam.c
2     --- ghostscript-9.04rc1/psi/zusparam.c.iccprofiles-initdir 2011-07-29 10:42:52.000000000 +0100
3     +++ ghostscript-9.04rc1/psi/zusparam.c 2011-08-01 12:32:41.203228412 +0100
4     @@ -605,6 +605,8 @@ set_default_gray_icc(i_ctx_t *i_ctx_p, g
5     return code;
6     }
7    
8     +extern_gx_io_device_table();
9     +
10     static void
11     current_icc_directory(i_ctx_t *i_ctx_p, gs_param_string * pval)
12     {
13     @@ -612,8 +614,21 @@ current_icc_directory(i_ctx_t *i_ctx_p,
14     const gs_lib_ctx_t *lib_ctx = ((gs_imager_state *)igs)->memory->gs_lib_ctx;
15    
16     if (lib_ctx->profiledir == NULL) {
17     - pval->data = (const byte *)rfs;
18     - pval->size = strlen(rfs);
19     + int have_rom_device = 0;
20     + int i;
21     +
22     + for (i = 0; i < gx_io_device_table_count; i++) {
23     + const gx_io_device *iodev = gx_io_device_table[i];
24     + const char *dname = iodev->dname;
25     +
26     + if (dname && strlen(dname) == 5 && !memcpy("%rom%", dname, 5)) {
27     + have_rom_device = 1;
28     + break;
29     + }
30     + }
31     +
32     + pval->data = (const byte *) (have_rom_device ? rfs : "");
33     + pval->size = strlen(pval->data);
34     } else {
35     pval->data = (const byte *)(lib_ctx->profiledir);
36     pval->size = lib_ctx->profiledir_len;