Don't return FcFalse even when no fonts dirs is configured

This commit is contained in:
Akira TAGOH 2015-06-17 16:15:35 +09:00
parent f6d61c9bee
commit 33fd436a3e
3 changed files with 13 additions and 0 deletions

View File

@ -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)))
{

View File

@ -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

View File

@ -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__