diff options
author | Keith Packard <keithp@keithp.com> | 2003-02-12 18:19:33 +0000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2003-02-12 18:19:33 +0000 |
commit | c8d5753c0fca4e4b2ab01d49b9a0b464b9b54cb4 (patch) | |
tree | c60a6970054d59eb5805540a0f7ccad8f60f0b53 /src/fcdir.c | |
parent | d2b5cc7e12cb3941080c8db07ba53ce975a914b2 (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.c | 11 |
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); |