summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2017-10-02 21:17:06 +0900
committerAkira TAGOH <akira@tagoh.org>2017-11-20 17:37:22 +0530
commitd7133f4ed7071c6ac257e8d4de0e438e22ca0254 (patch)
tree618377fe7fc528cb94cbf2cbdc3fb3a1ca2fcf24 /src
parentcf5acaed9621990d890a0dfd655494d7242aba26 (diff)
Don't call FcStat when the alias has already been added
We could assume that the targeted location is mapped at the different place when there are in the alias table.
Diffstat (limited to 'src')
-rw-r--r--src/fccfg.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/fccfg.c b/src/fccfg.c
index e1aef863..5b876eec 100644
--- a/src/fccfg.c
+++ b/src/fccfg.c
@@ -371,24 +371,17 @@ FcConfigAddCache (FcConfig *config, FcCache *cache,
for (i = 0; i < cache->dirs_count; i++)
{
const FcChar8 *dir = FcCacheSubdir (cache, i);
+ const FcChar8 *alias;
+ FcChar8 *d = FcStrDirname (dir);
FcChar8 *s = NULL;
- struct stat statb;
- if (FcStat (dir, &statb) < 0)
+ if ((alias = FcDirCacheFindAliasPath (d)))
{
- const FcChar8 *alias;
- FcChar8 *d = FcStrDirname (dir);
-
- if ((alias = FcDirCacheFindAliasPath (dir)))
- dir = alias;
- else if ((alias = FcDirCacheFindAliasPath (d)))
- {
- FcChar8 *base = FcStrBasename (dir);
- dir = s = FcStrBuildFilename (alias, base, NULL);
- FcStrFree (base);
- }
- FcStrFree (d);
+ FcChar8 *base = FcStrBasename (dir);
+ dir = s = FcStrBuildFilename (alias, base, NULL);
+ FcStrFree (base);
}
+ FcStrFree (d);
if (FcConfigAcceptFilename (config, dir))
FcStrSetAddFilename (dirSet, dir);
if (s)