From 33fd436a3ec63ca58f3cb51bd4ab7b33e90d89c8 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Wed, 17 Jun 2015 16:15:35 +0900 Subject: [PATCH] Don't return FcFalse even when no fonts dirs is configured --- src/fccfg.c | 2 ++ src/fcint.h | 3 +++ src/fcstr.c | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/src/fccfg.c b/src/fccfg.c index cc2d9ee..abf539c 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 15e22fd..ca6f8ef 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 29a577d..71e033a 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__