]> git.wh0rd.org - fontconfig.git/blobdiff - src/fccache.c
Free temporary string in FcDirCacheUnlink (Bug #11758)
[fontconfig.git] / src / fccache.c
index 7e2c1bec9363068b2b2ec31fb743a4c00fdec348..9e8819cbdc2d111d833353e329e18d635e74e31e 100644 (file)
@@ -104,6 +104,7 @@ FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config)
         if (!cache_hashed)
            break;
        (void) unlink ((char *) cache_hashed);
+       FcStrFree (cache_hashed);
     }
     FcStrListDone (list);
     /* return FcFalse if something went wrong */
@@ -454,7 +455,8 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat)
                                         PAGE_READONLY, 0, 0, NULL);
            if (hFileMap != NULL)
            {
-               cache = MapViewOfFile (hFileMap, FILE_MAP_READ, 0, 0, size);
+               cache = MapViewOfFile (hFileMap, FILE_MAP_READ, 0, 0, 
+                                      fd_stat->st_size);
                CloseHandle (hFileMap);
            }
        }
@@ -689,6 +691,11 @@ bail1:
     return NULL;
 }
 
+
+#ifdef _WIN32
+#define mkdir(path,mode) _mkdir(path)
+#endif
+
 static FcBool
 FcMakeDirectory (const FcChar8 *dir)
 {
@@ -820,16 +827,17 @@ FcDirCacheWrite (FcCache *cache, FcConfig *config)
  * Hokey little macro trick to permit the definitions of C functions
  * with the same name as CPP macros
  */
-#define args(x...)         (x)
+#define args1(x)           (x)
+#define args2(x,y)         (x,y)
 
 const FcChar8 *
-FcCacheDir args(const FcCache *c)
+FcCacheDir args1(const FcCache *c)
 {
     return FcCacheDir (c);
 }
 
 FcFontSet *
-FcCacheCopySet args(const FcCache *c)
+FcCacheCopySet args1(const FcCache *c)
 {
     FcFontSet  *old = FcCacheSet (c);
     FcFontSet  *new = FcFontSetCreate ();
@@ -852,19 +860,19 @@ FcCacheCopySet args(const FcCache *c)
 }
 
 const FcChar8 *
-FcCacheSubdir args(const FcCache *c, int i)
+FcCacheSubdir args2(const FcCache *c, int i)
 {
     return FcCacheSubdir (c, i);
 }
 
 int
-FcCacheNumSubdir args(const FcCache *c)
+FcCacheNumSubdir args1(const FcCache *c)
 {
     return c->dirs_count;
 }
 
 int
-FcCacheNumFont args(const FcCache *c)
+FcCacheNumFont args1(const FcCache *c)
 {
     return FcCacheSet(c)->nfont;
 }