fcdefault: Add the lang object at FcConfigSubstituteWithPat() only when kind is FcMatchPattern

This commit is contained in:
Akira TAGOH 2012-06-08 19:17:57 +09:00
parent 07e52eeb09
commit f4103bf708
1 changed files with 16 additions and 17 deletions

View File

@ -1419,22 +1419,6 @@ FcConfigSubstituteWithPat (FcConfig *config,
switch (kind) { switch (kind) {
case FcMatchPattern: case FcMatchPattern:
s = config->substPattern; s = config->substPattern;
break;
case FcMatchFont:
s = config->substFont;
break;
case FcMatchScan:
s = config->substScan;
break;
default:
return FcFalse;
}
st = (FcSubState *) malloc (config->maxObjects * sizeof (FcSubState));
if (!st && config->maxObjects)
return FcFalse;
FcMemAlloc (FC_MEM_SUBSTATE, config->maxObjects * sizeof (FcSubState));
strs = FcGetDefaultLangs (); strs = FcGetDefaultLangs ();
if (strs) if (strs)
{ {
@ -1451,6 +1435,21 @@ FcConfigSubstituteWithPat (FcConfig *config,
} }
FcStrListDone (l); FcStrListDone (l);
} }
break;
case FcMatchFont:
s = config->substFont;
break;
case FcMatchScan:
s = config->substScan;
break;
default:
return FcFalse;
}
st = (FcSubState *) malloc (config->maxObjects * sizeof (FcSubState));
if (!st && config->maxObjects)
return FcFalse;
FcMemAlloc (FC_MEM_SUBSTATE, config->maxObjects * sizeof (FcSubState));
if (FcDebug () & FC_DBG_EDIT) if (FcDebug () & FC_DBG_EDIT)
{ {