Allow passing NULL for file to FcFreeTypeQueryFace()

This commit is contained in:
Behdad Esfahbod 2014-05-16 15:08:52 -06:00
parent 3f992254f2
commit 58acd993cb
1 changed files with 2 additions and 2 deletions

View File

@ -1321,7 +1321,7 @@ FcFreeTypeQueryFace (const FT_Face face,
++nstyle;
}
if (!nfamily)
if (!nfamily && file && *file)
{
FcChar8 *start, *end;
FcChar8 *family;
@ -1395,7 +1395,7 @@ FcFreeTypeQueryFace (const FT_Face face,
if (!FcPatternAddString (pat, FC_POSTSCRIPT_NAME, (const FcChar8 *)psname))
goto bail1;
if (!FcPatternAddString (pat, FC_FILE, file))
if (file && *file && !FcPatternAddString (pat, FC_FILE, file))
goto bail1;
if (!FcPatternAddInteger (pat, FC_INDEX, id))