Don't crash on non-existant directories in global cache.

reviewed by: plam
This commit is contained in:
Patrick Lam 2006-01-26 16:11:41 +00:00
parent f468f568b4
commit 4073203deb
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2006-01-26 Mike Fabian <mfabian@suse.de>
reviewed by: plam
* src/fcacache.c (FcGlobalCacheReadDir):
Don't crash on non-existant directories in global cache.
2006-01-26 Patirck Lam <plam@mit.edu>
* src/fccache.c (FcGlobalCacheSave, FcDirCacheWrite):
* src/fccfg.c (FcConfigAddFontDirSubdirs, FcConfigNormalizeFontDir):

View File

@ -304,7 +304,9 @@ FcGlobalCacheReadDir (FcFontSet *set, FcStrSet *dirs, FcGlobalCache * cache, con
if (cache->fd == -1)
return FcFalse;
dir = (char *)FcConfigNormalizeFontDir (config, (FcChar8 *)dir);
if (!(dir = (char *)FcConfigNormalizeFontDir (config, (FcChar8 *)dir)))
return FcFalse; /* non-existing directory */
for (d = cache->dirs; d; d = d->next)
{
if (strncmp (d->name, dir, strlen(dir)) == 0)