From 204da5a8b88a73e54a9bab0537db7ff4fe8c6374 Mon Sep 17 00:00:00 2001 From: Patrick Lam Date: Thu, 8 Dec 2005 05:54:27 +0000 Subject: [PATCH] Because we've changed FcPatternAddString to use FcStrStaticName and not FcValueSave, explicitly handle the case of a null string. --- ChangeLog | 6 ++++++ src/fcpat.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index b13ebbb..2b4b555 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-12-07 Patrick Lam + * src/fcpat.c (FcPatternAddString): + + Because we've changed FcPatternAddString to use FcStrStaticName + and not FcValueSave, explicitly handle the case of a null string. + 2005-12-06 Patrick Lam * fc-cat/fc-cat.c (FcCachePrintSet, FcCacheGlobalFileReadAndPrint): diff --git a/src/fcpat.c b/src/fcpat.c index a626ab6..e2bdd30 100644 --- a/src/fcpat.c +++ b/src/fcpat.c @@ -1029,6 +1029,13 @@ FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s) { FcValue v; + if (!s) + { + v.type = FcTypeVoid; + v.u.s = 0; + return FcPatternAdd (p, object, v, FcTrue); + } + v.type = FcTypeString; v.u.s = FcStrStaticName(s); return FcPatternAdd (p, object, v, FcTrue); -- 2.39.5