if (cache->fd == -1)
return FcFalse;
- if (config)
- if (!(dir = (char *)FcConfigNormalizeFontDir (config, (FcChar8 *)dir)))
- return FcFalse; /* non-existing directory */
-
for (d = cache->dirs; d; d = d->next)
{
if (strcmp (d->name, dir) == 0)
FcBool
FcGlobalCacheUpdate (FcGlobalCache *cache,
FcStrSet *dirs,
- const char *orig_name,
+ const char *name,
FcFontSet *set,
FcConfig *config)
{
FcGlobalCacheDir *d;
int i;
- const char *name;
-
- name = (char *)FcConfigNormalizeFontDir (config, (FcChar8 *)orig_name);
- if (!name)
- {
- fprintf(stderr, "Invalid directory name %s\n", orig_name);
- return FcFalse;
- }
d = FcGlobalCacheDirFind (cache, name);
if (!dir->name || dir->state == FcGCDirDisabled)
continue;
- d = (const char *)FcConfigNormalizeFontDir (config, (const FcChar8 *)dir->name);
+ d = dir->name;
if (!d)
continue;
FcChar8 *cache_dir;
char dir_buf[FC_MAX_FILE_LEN];
- dir = FcConfigNormalizeFontDir (config, dir);
-
FcDirCacheBasename (dir, cache_base);
list = FcStrListCreate (config->cacheDirs);
FcChar8 *dir;
FcStrSet *subdirs;
FcStrList *sublist;
- struct stat statb;
FcGlobalCacheDir *d;
/*
* to avoid the looped directories via symlinks
* Clearly a dir not in fonts.conf shouldn't be globally cached.
*/
- dir = (FcChar8 *)FcConfigNormalizeFontDir (config, dir);
- if (!dir)
- continue;
if (FcStrSetMember (processed_dirs, dir))
continue;
continue;
}
- if (access ((char *) dir, X_OK) < 0)
- {
- switch (errno) {
- case ENOENT:
- case ENOTDIR:
- case EACCES:
- break;
- default:
- fprintf (stderr, "\"%s\": ", dir);
- perror ("");
- ret++;
- }
- FcStrSetDestroy (subdirs);
- continue;
- }
- if (stat ((char *) dir, &statb) == -1)
- {
- fprintf (stderr, "\"%s\": ", dir);
- perror ("");
- FcStrSetDestroy (subdirs);
- ret++;
- continue;
- }
- if (!S_ISDIR (statb.st_mode))
- {
- fprintf (stderr, "\"%s\": not a directory, skipping\n", dir);
- FcStrSetDestroy (subdirs);
- continue;
- }
if (FcDirCacheRead (set, subdirs, dir, config))
{
/* if an old entry is found in the global cache, disable it */
FcChar8 *cache_dir = NULL;
FcChar8 *test_dir;
- dir = FcConfigNormalizeFontDir (FcConfigGetCurrent(), dir);
- if (!dir)
- return FcFalse;
-
/*
* Write it to the first directory in the list which is writable
*/