]> git.pld-linux.org Git - packages/fontconfig.git/blob - fontconfig-subdir.patch
f69a25c50c766027b7ebfc70f1eb190c fontconfig-slighthint.patch
[packages/fontconfig.git] / fontconfig-subdir.patch
1 --- fontconfig/src/fcint.h.subdir       Sat Aug 31 18:17:32 2002
2 +++ fontconfig/src/fcint.h      Mon Sep  9 15:09:41 2002
3 @@ -238,18 +238,20 @@
4      FcChar8                    *name;
5  } FcGlobalCacheFile;
6  
7 +typedef struct _FcGlobalCacheDir FcGlobalCacheDir;
8 +
9  typedef struct _FcGlobalCacheSubdir {
10      struct _FcGlobalCacheSubdir        *next;
11 -    FcChar8                    *file;
12 +    FcGlobalCacheDir           *ent;
13  } FcGlobalCacheSubdir;
14  
15 -typedef struct _FcGlobalCacheDir {
16 +struct _FcGlobalCacheDir {
17      struct _FcGlobalCacheDir   *next;
18      FcGlobalCacheInfo          info;
19      int                                len;
20      FcGlobalCacheFile          *ents[FC_GLOBAL_CACHE_FILE_HASH_SIZE];
21      FcGlobalCacheSubdir                *subdirs;
22 -} FcGlobalCacheDir;
23 +};
24  
25  typedef struct _FcGlobalCache {
26      FcGlobalCacheDir           *ents[FC_GLOBAL_CACHE_DIR_HASH_SIZE];
27 --- fontconfig/src/fcdir.c.subdir       Mon Sep  9 13:04:09 2002
28 +++ fontconfig/src/fcdir.c      Mon Sep  9 15:09:41 2002
29 @@ -117,6 +117,8 @@
30             {
31                 isDir = FcTrue;
32                 ret = FcStrSetAdd (dirs, file);
33 +               if (cache && ret)
34 +                   FcGlobalCacheUpdate (cache, file, 0, FC_FONT_FILE_DIR);
35             }
36             /*
37              * Update the cache
38 --- fontconfig/src/fccache.c.subdir     Sat Aug 31 18:17:31 2002
39 +++ fontconfig/src/fccache.c    Mon Sep  9 15:09:41 2002
40 @@ -448,14 +448,11 @@
41      parent = FcGlobalCacheDirGet (cache, i.dir, i.dir_len, FcTrue);
42      if (!parent)
43         return 0;
44 -    subdir = malloc (sizeof (FcGlobalCacheSubdir) + 
45 -                    strlen ((const char *) i.base) + 1);
46 +    subdir = malloc (sizeof (FcGlobalCacheSubdir));
47      if (!subdir)
48         return 0;
49 -    FcMemAlloc (FC_MEM_CACHE, sizeof (FcGlobalCacheSubdir) +
50 -               strlen ((const char *) i.base) + 1);
51 -    subdir->file = (FcChar8 *) (subdir + 1);
52 -    strcpy ((char *) subdir->file, (const char *) i.base);
53 +    FcMemAlloc (FC_MEM_CACHE, sizeof (FcGlobalCacheSubdir));
54 +    subdir->ent = d;
55      subdir->next = parent->subdirs;
56      parent->subdirs = subdir;
57      return &d->info;
58 @@ -480,8 +477,7 @@
59      for (s = d->subdirs; s; s = nexts)
60      {
61         nexts = s->next;
62 -       FcMemFree (FC_MEM_CACHE, sizeof (FcGlobalCacheSubdir) +
63 -                  strlen ((char *) s->file) + 1);
64 +       FcMemFree (FC_MEM_CACHE, sizeof (FcGlobalCacheSubdir));
65         free (s);
66      }
67      FcMemFree (FC_MEM_CACHE, sizeof (FcGlobalCacheDir) + d->len + 1);
68 @@ -535,12 +531,15 @@
69         }
70      for (subdir = d->subdirs; subdir; subdir = subdir->next)
71      {
72 +       FcFilePathInfo  info = FcFilePathInfoGet (subdir->ent->info.file);
73 +       
74         if (!FcCacheFontSetAdd (set, dirs, dir, dir_len,
75 -                               subdir->file, FC_FONT_FILE_DIR))
76 +                               info.base, FC_FONT_FILE_DIR))
77         {
78             cache->broken = FcTrue;
79             return FcFalse;
80         }
81 +       FcGlobalCacheReferenced (cache, &subdir->ent->info);
82      }
83      
84      FcGlobalCacheReferenced (cache, &d->info);
This page took 0.113439 seconds and 3 git commands to generate.