summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2015-06-17 16:15:35 +0900
committerAkira TAGOH <akira@tagoh.org>2015-06-17 16:15:35 +0900
commit33fd436a3ec63ca58f3cb51bd4ab7b33e90d89c8 (patch)
tree88f5d66f386567143ada4fc38ae3e1e716c81166
parentf6d61c9beed856a925bd60c025b55284b2d88161 (diff)
Don't return FcFalse even when no fonts dirs is configured
-rw-r--r--src/fccfg.c2
-rw-r--r--src/fcint.h3
-rw-r--r--src/fcstr.c8
3 files changed, 13 insertions, 0 deletions
diff --git a/src/fccfg.c b/src/fccfg.c
index cc2d9ee6..abf539c5 100644
--- a/src/fccfg.c
+++ b/src/fccfg.c
@@ -373,6 +373,8 @@ FcConfigAddDirList (FcConfig *config, FcSetName set, FcStrSet *dirSet)
dirlist = FcStrListCreate (dirSet);
if (!dirlist)
return FcFalse;
+ if (FcStrListGetLength (dirlist) == 0)
+ ret = FcTrue;
while ((dir = FcStrListNext (dirlist)))
{
diff --git a/src/fcint.h b/src/fcint.h
index 15e22fdb..ca6f8eff 100644
--- a/src/fcint.h
+++ b/src/fcint.h
@@ -1176,6 +1176,9 @@ FcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str);
FcPrivate FcChar8 *
FcStrSerialize (FcSerialize *serialize, const FcChar8 *str);
+FcPrivate int
+FcStrListGetLength (const FcStrList *list);
+
/* fcobjs.c */
FcPrivate void
diff --git a/src/fcstr.c b/src/fcstr.c
index 29a577d1..71e033a1 100644
--- a/src/fcstr.c
+++ b/src/fcstr.c
@@ -1347,6 +1347,14 @@ FcStrListDone (FcStrList *list)
free (list);
}
+int
+FcStrListGetLength (const FcStrList *list)
+{
+ if (!list)
+ return 0;
+ return list->set->num;
+}
+
#define __fcstr__
#include "fcaliastail.h"
#undef __fcstr__