]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcdir.c
Dont cache directorys until theyve been scanned. Avoids losing subdir
[fontconfig.git] / src / fcdir.c
index 42aaf74ea6ed333ff84fab8615935e5b2b0369a0..08334ab2785fddff2820a184406c6b731c6c99c6 100644 (file)
@@ -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,
@@ -212,6 +215,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);