diff options
author | marha <marha@users.sourceforge.net> | 2012-02-22 09:28:23 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-02-22 09:28:23 +0100 |
commit | ecc59cb52ffe4a84fddae997bba64adad35d5e93 (patch) | |
tree | 233c2cf0ea65dcf0b671f28e14b1fb083dac87e3 /fontconfig/fc-match/fc-match.c | |
parent | d19dd4c9cf37b7b691552c4f4dd873471e31ca68 (diff) | |
parent | 6baac61e6ca9cd314e689dfe7f84771aad08c66e (diff) | |
download | vcxsrv-ecc59cb52ffe4a84fddae997bba64adad35d5e93.tar.gz vcxsrv-ecc59cb52ffe4a84fddae997bba64adad35d5e93.tar.bz2 vcxsrv-ecc59cb52ffe4a84fddae997bba64adad35d5e93.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'fontconfig/fc-match/fc-match.c')
-rw-r--r-- | fontconfig/fc-match/fc-match.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/fontconfig/fc-match/fc-match.c b/fontconfig/fc-match/fc-match.c index e64b4bcdd..4642c8dee 100644 --- a/fontconfig/fc-match/fc-match.c +++ b/fontconfig/fc-match/fc-match.c @@ -98,16 +98,16 @@ usage (char *program, int error) int main (int argc, char **argv) { - int verbose = 0; - int sort = 0, all = 0; - FcChar8 *format = NULL; - int i; - FcObjectSet *os = 0; - FcFontSet *fs; - FcPattern *pat; - FcResult result; + int verbose = 0; + int sort = 0, all = 0; + const FcChar8 *format = NULL; + int i; + FcObjectSet *os = 0; + FcFontSet *fs; + FcPattern *pat; + FcResult result; #if HAVE_GETOPT_LONG || HAVE_GETOPT - int c; + int c; #if HAVE_GETOPT_LONG while ((c = getopt_long (argc, argv, "asvf:Vh", longopts, NULL)) != -1) @@ -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; @@ -198,9 +203,9 @@ main (int argc, char **argv) if (!format) { if (os) - format = "%{=unparse}\n"; + format = (const FcChar8 *) "%{=unparse}\n"; else - format = "%{=fcmatch}\n"; + format = (const FcChar8 *) "%{=fcmatch}\n"; } if (fs) |