summaryrefslogtreecommitdiff
path: root/fc-match
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2012-02-21 15:29:56 +0900
committerAkira TAGOH <akira@tagoh.org>2012-02-21 15:29:56 +0900
commita18ca17b6211f62fbd1d893811b94b8c83db4cc0 (patch)
treee5ba6cc66572fa6a751c090be9c3ab87c1094043 /fc-match
parentcbb6ee1662f1219518677a9d489159778a812782 (diff)
Bug 40452 - Running 'fc-match --all' core dumps when no fonts are installed
This would changes the behavior of FcFontSort(). it won't returns NULL afterward.
Diffstat (limited to 'fc-match')
-rw-r--r--fc-match/fc-match.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fc-match/fc-match.c b/fc-match/fc-match.c
index e64b4bc..095dd4e 100644
--- a/fc-match/fc-match.c
+++ b/fc-match/fc-match.c
@@ -175,6 +175,11 @@ main (int argc, char **argv)
int j;
font_patterns = FcFontSort (0, pat, all ? FcFalse : FcTrue, 0, &result);
+ if (!font_patterns || font_patterns->nfont == 0)
+ {
+ fputs("No fonts installed on the system\n", stderr);
+ return 1;
+ }
for (j = 0; j < font_patterns->nfont; j++)
{
FcPattern *font_pattern;