/[packages]/cauldron/ghostscript/current/SOURCES/ghostscript-iccprofiles-initdir.patch
ViewVC logotype

Diff of /cauldron/ghostscript/current/SOURCES/ghostscript-iccprofiles-initdir.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 289699 by luigiwalser, Fri Sep 7 23:51:02 2012 UTC revision 292200 by blino, Tue Sep 11 08:53:06 2012 UTC
# Line 1  Line 1 
1  --- ghostscript-9.06/base/gsicc_manage.c.0028~  2012-08-08 10:01:36.000000000 +0200  diff -up ghostscript-9.06/base/gsicc_manage.c.iccprofiles-initdir ghostscript-9.06/base/gsicc_manage.c
2  +++ ghostscript-9.06/base/gsicc_manage.c        2012-08-12 19:20:56.447641534 +0200  --- ghostscript-9.06/base/gsicc_manage.c.iccprofiles-initdir    2012-08-09 13:58:22.102364807 +0100
3  @@ -18,6 +18,7 @@  +++ ghostscript-9.06/base/gsicc_manage.c        2012-08-09 14:09:24.495864641 +0100
4   #include "std.h"  @@ -38,6 +38,7 @@
5   #include "stdpre.h"   #include "gsicc_create.h"
6   #include "gstypes.h"   #include "gpmisc.h"
7     #include "gxdevice.h"
8  +#include "gxiodev.h"  +#include "gxiodev.h"
  #include "gsmemory.h"  
  #include "gsstruct.h"  
  #include "scommon.h"  
 @@ -2163,6 +2164,8 @@ gs_setdefaultgrayicc(const gs_state * pg  
      return code;  
  }  
9    
10  +extern_gx_io_device_table();   #define ICC_HEADER_SIZE 128
11  +  
12   void  @@ -2176,8 +2177,21 @@ gs_currenticcdirectory(const gs_state *
  gs_currenticcdirectory(const gs_state * pgs, gs_param_string * pval)  
  {  
 @@ -2170,8 +2173,19 @@ gs_currenticcdirectory(const gs_state *  
13       const gs_lib_ctx_t *lib_ctx = pgs->memory->gs_lib_ctx;       const gs_lib_ctx_t *lib_ctx = pgs->memory->gs_lib_ctx;
14    
15       if (lib_ctx->profiledir == NULL) {       if (lib_ctx->profiledir == NULL) {
16  -        pval->data = (const byte *)rfs;  -        pval->data = (const byte *)rfs;
17  -        pval->size = strlen(rfs);  -        pval->size = strlen(rfs);
18  +        int have_rom_device = 0;  +       int have_rom_device = 0;
19  +        int i;  +       int i;
 +        for(i = 0; i < gx_io_device_table_count; i++) {  
 +            const gx_io_device *iodev = gx_io_device_table[i];  
 +            const char *dname = iodev->dname;  
20  +  +
21  +            if (dname && strlen(dname) == 5 && !memcpy("%rom%", dname, 5)) {  +       for (i = 0; i < gx_io_device_table_count; i++) {
22  +                have_rom_device = 1;  +           const gx_io_device *iodev = lib_ctx->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;  +               break;
28  +           }  +           }
29  +       }  +       }
30  +        pval->data = (const byte *) (have_rom_device ? rfs : "");  +
31  +        pval->size = strlen(pval->data);  +        pval->data = (const byte *)(have_rom_device ? rfs : "");
32    +        pval->size = strlen((const char *)pval->data);
33           pval->persistent = true;           pval->persistent = true;
34       } else {       } else {
35           pval->data = (const byte *)(lib_ctx->profiledir);           pval->data = (const byte *)(lib_ctx->profiledir);

Legend:
Removed from v.289699  
changed lines
  Added in v.292200

  ViewVC Help
Powered by ViewVC 1.1.28