From 8ec077f22b2f9fd693abfda7d405ac572594be99 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 2 Jun 2002 19:51:36 +0000 Subject: [PATCH] Expression parsing in fonts.conf file mis-freed elements. Constant identity matrix was accidentally freed. Add ability to comare FTFace pattern elements (not that its all that useful) --- src/fccfg.c | 18 +++++++++++++++--- src/fcxml.c | 5 +++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/fccfg.c b/src/fccfg.c index edb6df3..65a5728 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/fontconfig/src/fccfg.c,v 1.6 2002/05/21 17:06:22 keithp Exp $ + * $XFree86: xc/lib/fontconfig/src/fccfg.c,v 1.7 2002/05/29 08:21:33 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -471,8 +471,9 @@ FcConfigPromote (FcValue v, FcValue u) } else if (v.type == FcTypeVoid && u.type == FcTypeMatrix) { - v.u.m = (FcMatrix *) &FcIdentityMatrix; - v.type = FcTypeMatrix; + v.u.m = FcMatrixCopy (&FcIdentityMatrix); + if (v.u.m) + v.type = FcTypeMatrix; } return v; } @@ -582,6 +583,17 @@ FcConfigCompareValue (FcValue m, break; } break; + case FcTypeFTFace: + switch (op) { + case FcOpEqual: + ret = m.u.f == v.u.f; + break; + case FcOpNotEqual: + ret = m.u.f != v.u.f; + break; + default: + break; + } } } else diff --git a/src/fcxml.c b/src/fcxml.c index 1aa282d..09aa79e 100644 --- a/src/fcxml.c +++ b/src/fcxml.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/fontconfig/src/fcxml.c,v 1.7 2002/05/21 17:06:22 keithp Exp $ + * $XFree86: xc/lib/fontconfig/src/fcxml.c,v 1.8 2002/05/22 04:12:35 keithp Exp $ * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * @@ -1188,6 +1188,7 @@ FcPopExpr (FcConfigParse *parse) break; case FcVStackExpr: expr = vstack->u.expr; + vstack->tag = FcVStackNone; break; case FcVStackEdit: break; @@ -1377,7 +1378,7 @@ FcParseEdit (FcConfigParse *parse) } mode_string = FcConfigGetAttribute (parse, "mode"); if (!mode_string) - mode = FcOpEqual; + mode = FcOpAssign; else { mode = FcConfigLexMode (mode_string); -- 2.39.2