From 6d3b306cbecac22f4e0974c1a6e836289bd522f4 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Tue, 19 Sep 2017 20:21:22 +0900 Subject: [PATCH] Replace the original path to the new one --- src/fclist.c | 6 +++--- src/fcmatch.c | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/fclist.c b/src/fclist.c index d7cd5c8..835cc32 100644 --- a/src/fclist.c +++ b/src/fclist.c @@ -448,7 +448,6 @@ FcListAppend (FcListHashTable *table, e = FcPatternObjectFindElt (font, FcObjectFromName (os->objects[o])); if (e) { - idx = 0; if (FcRefIsConst (&font->ref) && !strcmp (os->objects[o], FC_FILE)) { struct stat statb; @@ -481,13 +480,13 @@ FcListAppend (FcListHashTable *table, } FcStrFree (s); FcStrFree (dir); - idx++; + goto bail3; } else FcStrFree (dir); } } - for (v = FcPatternEltValues(e); v; + for (v = FcPatternEltValues(e), idx = 0; v; v = FcValueListNext(v), ++idx) { if (!FcPatternAdd (bucket->pattern, @@ -495,6 +494,7 @@ FcListAppend (FcListHashTable *table, FcValueCanonicalize(&v->value), defidx != idx)) goto bail2; } + bail3:; } } *prev = bucket; diff --git a/src/fcmatch.c b/src/fcmatch.c index 30070f4..261254f 100644 --- a/src/fcmatch.c +++ b/src/fcmatch.c @@ -670,6 +670,7 @@ FcFontRenderPrepare (FcConfig *config, FcTrue); FcStrFree (s); FcStrFree (dir); + goto bail0; } else FcStrFree (dir); @@ -678,6 +679,7 @@ FcFontRenderPrepare (FcConfig *config, FcPatternObjectListAdd (new, fe->object, FcValueListDuplicate (FcPatternEltValues (fe)), FcTrue); + bail0:; } } for (i = 0; i < pat->num; i++)