summaryrefslogtreecommitdiff
path: root/src/fcdir.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2003-02-12 18:19:33 +0000
committerKeith Packard <keithp@keithp.com>2003-02-12 18:19:33 +0000
commitc8d5753c0fca4e4b2ab01d49b9a0b464b9b54cb4 (patch)
treec60a6970054d59eb5805540a0f7ccad8f60f0b53 /src/fcdir.c
parentd2b5cc7e12cb3941080c8db07ba53ce975a914b2 (diff)
Dont cache directorys until theyve been scanned. Avoids losing subdir
contents. Also fixed cache hashing function (was returning constant). Lots of comments
Diffstat (limited to 'src/fcdir.c')
-rw-r--r--src/fcdir.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/fcdir.c b/src/fcdir.c
index 42aaf74..08334ab 100644
--- a/src/fcdir.c
+++ b/src/fcdir.c
@@ -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);