Hoist FcFileIsDir check out of FcFileScanConfig loop.
reviewed by: plam
This commit is contained in:
parent
a0aa54f6ee
commit
98592bbb1d
|
@ -1,3 +1,9 @@
|
||||||
|
2006-02-06 Takashi Iwai <tiwai@suse.de>
|
||||||
|
reviewed by: plam
|
||||||
|
* src/fcdir.c (FcFileScanConfig):
|
||||||
|
|
||||||
|
Hoist FcFileIsDir check out of FcFileScanConfig loop.
|
||||||
|
|
||||||
2006-02-06 Takashi Iwai <tiwai@suse.de>
|
2006-02-06 Takashi Iwai <tiwai@suse.de>
|
||||||
reviewed by: plam
|
reviewed by: plam
|
||||||
|
|
||||||
|
|
11
src/fcdir.c
11
src/fcdir.c
|
@ -47,14 +47,17 @@ FcFileScanConfig (FcFontSet *set,
|
||||||
int id;
|
int id;
|
||||||
FcPattern *font;
|
FcPattern *font;
|
||||||
FcBool ret = FcTrue;
|
FcBool ret = FcTrue;
|
||||||
FcBool isDir;
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
if (config && !FcConfigAcceptFilename (config, file))
|
if (config && !FcConfigAcceptFilename (config, file))
|
||||||
return FcTrue;
|
return FcTrue;
|
||||||
|
|
||||||
|
if (FcFileIsDir (file))
|
||||||
|
return FcStrSetAdd (dirs, file);
|
||||||
|
|
||||||
if (force)
|
if (force)
|
||||||
cache = 0;
|
cache = 0;
|
||||||
|
|
||||||
id = 0;
|
id = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -70,12 +73,6 @@ FcFileScanConfig (FcFontSet *set,
|
||||||
font = FcFreeTypeQuery (file, id, blanks, &count);
|
font = FcFreeTypeQuery (file, id, blanks, &count);
|
||||||
if (FcDebug () & FC_DBG_SCAN)
|
if (FcDebug () & FC_DBG_SCAN)
|
||||||
printf ("done\n");
|
printf ("done\n");
|
||||||
isDir = FcFalse;
|
|
||||||
if (!font && FcFileIsDir (file))
|
|
||||||
{
|
|
||||||
isDir = FcTrue;
|
|
||||||
ret = FcStrSetAdd (dirs, file);
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Add the font
|
* Add the font
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue