X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=src%2Ffcdir.c;h=48755deb244cb708d7133126c92e3cd5da93964f;hb=db6f19f13b1719617c54a1658b8faa31da56e1d4;hp=a55c5fd3a47f5d301f58887c6d141b26d663683a;hpb=c2c6976d1a88cc35143ffcc34f3c38d0a28d34f4;p=fontconfig.git diff --git a/src/fcdir.c b/src/fcdir.c index a55c5fd..48755de 100644 --- a/src/fcdir.c +++ b/src/fcdir.c @@ -65,7 +65,7 @@ FcFileScanFontConfig (FcFontSet *set, /* * Edit pattern with user-defined rules */ - if (config && !FcConfigSubstituteWithPat (config, font, NULL, FcMatchScan)) + if (font && config && !FcConfigSubstituteWithPat (config, font, NULL, FcMatchScan)) { FcPatternDestroy (font); font = NULL; @@ -146,6 +146,7 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config) int i; FcBlanks *blanks = FcConfigGetBlanks (config); FcCache *cache = NULL; + struct stat dir_stat; if (FcDebug () & FC_DBG_FONTSET) printf ("cache scan dir %s\n", dir); @@ -174,6 +175,11 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config) ret = FcFalse; goto bail_1; } + if (stat ((char *) dir, &dir_stat) < 0) + { + ret = FcFalse; + goto bail_1; + } set = FcFontSetCreate(); if (!set) @@ -218,7 +224,7 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config) /* * Build the cache object */ - cache = FcDirCacheBuild (set, dir, dirs); + cache = FcDirCacheBuild (set, dir, &dir_stat, dirs); if (!cache) goto bail3; @@ -273,7 +279,7 @@ FcDirScanConfig (FcFontSet *set, FcBool force, FcConfig *config) { - return FcFalse; /* XXX fixme */ + return FcFalse; /* XXX deprecated */ } FcBool @@ -284,7 +290,7 @@ FcDirScan (FcFontSet *set, const FcChar8 *dir, FcBool force) { - return FcDirScanConfig (set, dirs, blanks, dir, force, NULL); + return FcFalse; /* XXX deprecated */ } FcBool @@ -292,3 +298,6 @@ FcDirSave (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir) { return FcFalse; /* XXX deprecated */ } +#define __fcdir__ +#include "fcaliastail.h" +#undef __fcdir__