aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcdir.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-06-08 15:05:49 +0200
committermarha <marha@users.sourceforge.net>2014-06-08 15:05:49 +0200
commit71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec (patch)
treeea689cdd51f395980ddc37dc33781635976f3a16 /fontconfig/src/fcdir.c
parentaec798fb4dc72d616732d0fa711faffaa8cd7590 (diff)
parent2acb86c9b086bdb9a3897db0b93820652e07cb59 (diff)
downloadvcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.tar.gz
vcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.tar.bz2
vcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.zip
Merge remote-tracking branch 'origin/released'
Conflicts: apps/xwininfo/xwininfo.c xorg-server/hw/xwin/glx/indirect.c
Diffstat (limited to 'fontconfig/src/fcdir.c')
-rw-r--r--fontconfig/src/fcdir.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/fontconfig/src/fcdir.c b/fontconfig/src/fcdir.c
index 3bcd0b867..49259c1f2 100644
--- a/fontconfig/src/fcdir.c
+++ b/fontconfig/src/fcdir.c
@@ -164,7 +164,8 @@ FcDirScanConfig (FcFontSet *set,
FcBlanks *blanks,
const FcChar8 *dir,
FcBool force, /* XXX unused */
- FcConfig *config)
+ FcConfig *config,
+ FcBool scanOnly)
{
DIR *d;
struct dirent *e;
@@ -180,7 +181,7 @@ FcDirScanConfig (FcFontSet *set,
if (!set && !dirs)
return FcTrue;
- if (!blanks)
+ if (!blanks && !scanOnly)
blanks = FcConfigGetBlanks (config);
/* freed below */
@@ -233,7 +234,17 @@ FcDirScanConfig (FcFontSet *set,
* Scan file files to build font patterns
*/
for (i = 0; i < files->num; i++)
- FcFileScanConfig (set, dirs, blanks, files->strs[i], config);
+ {
+ if (scanOnly)
+ {
+ if (FcFileIsDir (files->strs[i]))
+ FcStrSetAdd (dirs, files->strs[i]);
+ }
+ else
+ {
+ FcFileScanConfig (set, dirs, blanks, files->strs[i], config);
+ }
+ }
bail2:
FcStrSetDestroy (files);
@@ -257,7 +268,14 @@ FcDirScan (FcFontSet *set,
if (cache || !force)
return FcFalse;
- return FcDirScanConfig (set, dirs, blanks, dir, force, FcConfigGetCurrent ());
+ return FcDirScanConfig (set, dirs, blanks, dir, force, FcConfigGetCurrent (), FcFalse);
+}
+
+FcBool
+FcDirScanOnly (FcStrSet *dirs,
+ const FcChar8 *dir)
+{
+ return FcDirScanConfig (NULL, dirs, NULL, dir, FcTrue, NULL, FcTrue);
}
/*
@@ -288,7 +306,7 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config)
/*
* Scan the dir
*/
- if (!FcDirScanConfig (set, dirs, NULL, dir, FcTrue, config))
+ if (!FcDirScanConfig (set, dirs, NULL, dir, FcTrue, config, FcFalse))
goto bail2;
/*
@@ -330,7 +348,7 @@ FcDirCacheRescan (const FcChar8 *dir, FcConfig *config)
/*
* Scan the dir
*/
- if (!FcDirScanConfig (NULL, dirs, NULL, dir, FcTrue, config))
+ if (!FcDirScanConfig (NULL, dirs, NULL, dir, FcTrue, config, FcFalse))
goto bail1;
/*
* Rebuild the cache object