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) {
case FcMatchPattern:
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 ();
if (strs)
{
@ -1451,6 +1435,21 @@ FcConfigSubstituteWithPat (FcConfig *config,
}
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)
{