Annotation of /trunk/ghostscript-gpl/patches/ghostscript-gpl-9.01-iccprofiles-initdir.patch
Parent Directory | Revision Log
Revision 1374 -
(hide annotations)
(download)
Wed Jun 29 12:17:32 2011 UTC (13 years, 3 months ago) by niro
File size: 1356 byte(s)
Wed Jun 29 12:17:32 2011 UTC (13 years, 3 months ago) by niro
File size: 1356 byte(s)
added fedora patches
1 | niro | 1374 | diff -up ghostscript-9.01/psi/zusparam.c.iccprofiles-initdir ghostscript-9.01/psi/zusparam.c |
2 | --- ghostscript-9.01/psi/zusparam.c.iccprofiles-initdir 2010-11-16 14:48:31.000000000 +0000 | ||
3 | +++ ghostscript-9.01/psi/zusparam.c 2011-02-10 09:51:59.107972983 +0000 | ||
4 | @@ -607,12 +607,31 @@ 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 | static const char *const rfs = DEFAULT_DIR_ICC; /* as good as any other */ | ||
14 | const gs_imager_state * pis = (gs_imager_state *) igs; | ||
15 | + int have_rom_device = 0; | ||
16 | + | ||
17 | + if (pis->icc_manager->profiledir != NULL) | ||
18 | + pval->data = (const byte *) pis->icc_manager->profiledir; | ||
19 | + else { | ||
20 | + int i; | ||
21 | + for (i = 0; i < gx_io_device_table_count; i++) { | ||
22 | + const gx_io_device *iodev = gx_io_device_table[i]; | ||
23 | + const char *dname = iodev->dname; | ||
24 | + | ||
25 | + if (dname && strlen(dname) == 5 && !memcmp("%rom%", dname, 5)) { | ||
26 | + have_rom_device = 1; | ||
27 | + break; | ||
28 | + } | ||
29 | + } | ||
30 | |||
31 | + pval->data = (const byte *) (have_rom_device ? rfs : ""); | ||
32 | + } | ||
33 | pval->data = (const byte *)( (pis->icc_manager->profiledir == NULL) ? | ||
34 | rfs : pis->icc_manager->profiledir); | ||
35 | pval->size = strlen((const char *)pval->data); |