From 58acd993cb13b58c61633174071ef42da3dcac85 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 16 May 2014 15:08:52 -0600 Subject: [PATCH] Allow passing NULL for file to FcFreeTypeQueryFace() --- src/fcfreetype.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fcfreetype.c b/src/fcfreetype.c index 72da5ca..3dd865a 100644 --- a/src/fcfreetype.c +++ b/src/fcfreetype.c @@ -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))