From 58bdd29619e6580477918f8c8d77aadbe5e427a4 Mon Sep 17 00:00:00 2001 From: Patrick Lam Date: Wed, 18 Jan 2006 15:41:15 +0000 Subject: [PATCH] Properly order the FcConfigAddFontDir and FcConfigNormalizeFontDir calls to avoid crashes. reviewed by: plam --- ChangeLog | 8 ++++++++ src/fcdir.c | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8bcf9fb..18a626c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-01-18 Mike Fabian + reviewed by: plam + + * src/fcdir.c (FcDirScanConfig): + + Properly order the FcConfigAddFontDir and FcConfigNormalizeFontDir + calls to avoid crashes. + 2006-01-14 Patirck Lam * src/fccache.c (FcDirCacheConsume): diff --git a/src/fcdir.c b/src/fcdir.c index 3e6acae..6db0b8b 100644 --- a/src/fcdir.c +++ b/src/fcdir.c @@ -131,6 +131,9 @@ FcDirScanConfig (FcFontSet *set, if (config && !FcConfigAcceptFilename (config, dir)) return FcTrue; + if (config) + FcConfigAddFontDir (config, dir); + if (!force) { /* @@ -165,7 +168,6 @@ FcDirScanConfig (FcFontSet *set, return FcFalse; } - FcConfigAddFontDir (config, dir); tmpSet = FcFontSetCreate(); if (!tmpSet) {