summaryrefslogtreecommitdiff
path: root/src/fclang.c
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2014-05-13 21:21:43 +0900
committerAkira TAGOH <akira@tagoh.org>2014-05-13 21:22:17 +0900
commit48c8b7938a0f1412d31dbe2f4e332e460f624068 (patch)
tree1deec0eb6ef151a151da09b681069162b97a04a4 /src/fclang.c
parent81664fe54f117e4781fda5a30429b51858302e91 (diff)
Allow the modification on FcTypeVoid with FcTypeLangSet and FcTypeCharSet
FcTypeVoid is likely to happen when 'lang' and 'charset' is deleted by 'delete' or 'delete_all' mode in edit. Without this change, any modification on them are simply ignored. This is useful to make a lot of changes, particularly when one wants to add a few and delete a lot say.
Diffstat (limited to 'src/fclang.c')
-rw-r--r--src/fclang.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/fclang.c b/src/fclang.c
index 9f685f6..b1fd1bc 100644
--- a/src/fclang.c
+++ b/src/fclang.c
@@ -720,19 +720,22 @@ FcLangSetPromote (const FcChar8 *lang, FcValuePromotionBuffer *vbuf)
memset (buf->ls.map, '\0', sizeof (buf->ls.map));
buf->ls.map_size = NUM_LANG_SET_MAP;
buf->ls.extra = 0;
- id = FcLangSetIndex (lang);
- if (id > 0)
+ if (lang)
{
- FcLangSetBitSet (&buf->ls, id);
- }
- else
- {
- buf->ls.extra = &buf->strs;
- buf->strs.num = 1;
- buf->strs.size = 1;
- buf->strs.strs = &buf->str;
- FcRefInit (&buf->strs.ref, 1);
- buf->str = (FcChar8 *) lang;
+ id = FcLangSetIndex (lang);
+ if (id > 0)
+ {
+ FcLangSetBitSet (&buf->ls, id);
+ }
+ else
+ {
+ buf->ls.extra = &buf->strs;
+ buf->strs.num = 1;
+ buf->strs.size = 1;
+ buf->strs.strs = &buf->str;
+ FcRefInit (&buf->strs.ref, 1);
+ buf->str = (FcChar8 *) lang;
+ }
}
return &buf->ls;
}