summaryrefslogtreecommitdiff
path: root/fc-scan/fc-scan.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-02-09 23:08:08 -0500
committerBehdad Esfahbod <behdad@behdad.org>2009-02-15 13:40:26 -0800
commit8c31a2434d5dfa475ef710ad52c992111caac424 (patch)
tree91a60b276619bcd78639b68698c31ea86d54404c /fc-scan/fc-scan.c
parentd6506ff6eeb4a4cb0bfe827174e474c7b91ff045 (diff)
[fcformat] Add element filtering and deletion
The filtering, '%{+elt1,elt2,elt3{subexpr}}' will evaluate subexpr with a pattern only having the listed elements from the surrounding pattern. The deletion, '%{-elt1,elt2,elt3{subexpr}}' will evaluate subexpr with a the surrounding pattern sans the listed elements.
Diffstat (limited to 'fc-scan/fc-scan.c')
-rw-r--r--fc-scan/fc-scan.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fc-scan/fc-scan.c b/fc-scan/fc-scan.c
index 573f7ef5..1f023fb3 100644
--- a/fc-scan/fc-scan.c
+++ b/fc-scan/fc-scan.c
@@ -165,8 +165,11 @@ main (int argc, char **argv)
FcChar8 *s;
s = FcPatternFormat (pat, format);
- printf ("%s", s);
- free (s);
+ if (s)
+ {
+ printf ("%s", s);
+ free (s);
+ }
}
else
{