]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcdir.c
Ship manual
[fontconfig.git] / src / fcdir.c
index 42aaf74ea6ed333ff84fab8615935e5b2b0369a0..264c5b4ceaba1a2fd2d9fef751331182f999ed5e 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * $XFree86: xc/lib/fontconfig/src/fcdir.c,v 1.9 2002/08/31 22:17:32 keithp Exp $
+ * $RCSId: xc/lib/fontconfig/src/fcdir.c,v 1.9 2002/08/31 22:17:32 keithp Exp $
  *
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -117,8 +117,6 @@ FcFileScan (FcFontSet           *set,
            {
                isDir = FcTrue;
                ret = FcStrSetAdd (dirs, file);
-               if (cache && ret)
-                   FcGlobalCacheUpdate (cache, file, 0, FC_FONT_FILE_DIR);
            }
            /*
             * Update the cache
@@ -154,6 +152,11 @@ FcFileScan (FcFontSet          *set,
 
 #define FC_MAX_FILE_LEN            4096
 
+/*
+ * Scan 'dir', adding font files to 'set' and
+ * subdirectories to 'dirs'
+ */
+
 FcBool
 FcDirScan (FcFontSet       *set,
           FcStrSet         *dirs,
@@ -174,7 +177,11 @@ FcDirScan (FcFontSet           *set,
         * Check fonts.cache-<version> file
         */
        if (FcDirCacheReadDir (set, dirs, dir))
+       {
+           if (cache)
+               FcGlobalCacheReferenceSubdir (cache, dir);
            return FcTrue;
+       }
     
        /*
         * Check ~/.fonts.cache-<version> file
@@ -212,6 +219,10 @@ FcDirScan (FcFontSet           *set,
     }
     free (file);
     closedir (d);
+    /*
+     * Now that the directory has been scanned,
+     * add the cache entry 
+     */
     if (ret && cache)
        FcGlobalCacheUpdate (cache, dir, 0, 0);