View | Details | Raw Unified | Return to bug 148693
Collapse All | Expand All

(-)src/fccfg.c-dist (-9 / +28 lines)
Lines 418-428 FcBool Link Here
418
FcConfigAddFontDir (FcConfig	    *config,
418
FcConfigAddFontDir (FcConfig	    *config,
419
		    const FcChar8   *d)
419
		    const FcChar8   *d)
420
{
420
{
421
#if 1 /* to be sure */
422
    /* already exists? */
423
    if (FcConfigLookupAllDirs(config, d))
424
	return FcTrue;
425
#endif
426
    return FcStrSetAddFilename (config->fontDirs, d);
421
    return FcStrSetAddFilename (config->fontDirs, d);
427
}
422
}
428
423
Lines 1879-1887 FcConfigAppFontAddFile (FcConfig *con Link Here
1879
    return FcTrue;
1874
    return FcTrue;
1880
}
1875
}
1881
1876
1882
FcBool
1877
static FcBool
1883
FcConfigAppFontAddDir (FcConfig	    *config,
1878
FcConfigAppFontAddDirWithCheck (FcConfig	    *config,
1884
		       const FcChar8   *dir)
1879
				const FcChar8   *dir,
1880
				FcStrSet *processed_dirs)
1885
{
1881
{
1886
    FcFontSet	*set;
1882
    FcFontSet	*set;
1887
    FcStrSet	*subdirs;
1883
    FcStrSet	*subdirs;
Lines 1915-1925 FcConfigAppFontAddDir (FcConfig *con Link Here
1915
	FcStrSetDestroy (subdirs);
1911
	FcStrSetDestroy (subdirs);
1916
	return FcFalse;
1912
	return FcFalse;
1917
    }
1913
    }
1914
    FcStrSetAdd (processed_dirs, dir);
1918
    if ((sublist = FcStrListCreate (subdirs)))
1915
    if ((sublist = FcStrListCreate (subdirs)))
1919
    {
1916
    {
1920
	while ((subdir = FcStrListNext (sublist)))
1917
	while ((subdir = FcStrListNext (sublist)))
1921
	{
1918
	{
1922
	    FcConfigAppFontAddDir (config, subdir);
1919
	    FcChar8 *name;
1920
	    name = FcConfigNormalizeFontDir (config, subdir);
1921
	    if (! name)
1922
		name = subdir;
1923
	    if (! FcStrSetMember (processed_dirs, name))
1924
		FcConfigAppFontAddDirWithCheck (config, name, processed_dirs);
1923
	}
1925
	}
1924
	FcStrListDone (sublist);
1926
	FcStrListDone (sublist);
1925
    }
1927
    }
Lines 1927-1932 FcConfigAppFontAddDir (FcConfig *con Link Here
1927
    return FcTrue;
1929
    return FcTrue;
1928
}
1930
}
1929
1931
1932
FcBool
1933
FcConfigAppFontAddDir (FcConfig	    *config,
1934
		       const FcChar8   *dir)
1935
{
1936
    FcStrSet *processed_dirs;
1937
    FcBool res;
1938
1939
    processed_dirs = FcStrSetCreate ();
1940
    if (! processed_dirs)
1941
	return FcFalse;
1942
1943
    res = FcConfigAppFontAddDirWithCheck (config, dir, processed_dirs);
1944
    FcStrSetDestroy (processed_dirs);
1945
1946
    return res;
1947
}
1948
1930
void
1949
void
1931
FcConfigAppFontClear (FcConfig	    *config)
1950
FcConfigAppFontClear (FcConfig	    *config)
1932
{
1951
{
(-)src/fccache.c-dist (-7 / +6 lines)
Lines 879-890 FcCacheReadDirs (FcConfig * config, FcGl Link Here
879
	    continue;
879
	    continue;
880
880
881
	/* Skip this directory if already scanned */
881
	/* Skip this directory if already scanned */
882
	name = FcConfigNormalizeFontDir (config, dir);
882
	dir = FcConfigNormalizeFontDir (config, dir);
883
	if (name) {
883
	if (! dir)
884
	    if (FcStrSetMember (processed_dirs, dir))
884
	    continue;
885
		continue;
885
	if (! FcStrSetAdd (processed_dirs, dir))
886
	    FcStrSetAdd (processed_dirs, dir);
886
	    continue;
887
	}
888
887
889
	subdirs = FcStrSetCreate ();
888
	subdirs = FcStrSetCreate ();
890
	if (!subdirs)
889
	if (!subdirs)
Lines 926-932 FcCacheReadDirs (FcConfig * config, FcGl Link Here
926
	if (FcDirCacheValid (dir) && FcDirCacheRead (set, subdirs, dir, config))
925
	if (FcDirCacheValid (dir) && FcDirCacheRead (set, subdirs, dir, config))
927
	{
926
	{
928
	    /* if an old entry is found in the global cache, disable it */
927
	    /* if an old entry is found in the global cache, disable it */
929
	    if ((d = FcGlobalCacheDirFind (cache, (const char *)name)) != NULL) {
928
	    if ((d = FcGlobalCacheDirFind (cache, (const char *)dir)) != NULL) {
930
		d->state = FcGCDirDisabled;
929
		d->state = FcGCDirDisabled;
931
		/* save the updated config later without this entry */
930
		/* save the updated config later without this entry */
932
		cache->updated = FcTrue;
931
		cache->updated = FcTrue;
(-)src/fcdir.c-dist (-5 / +1 lines)
Lines 129-139 FcDirScanConfig (FcFontSet *set, Link Here
129
	return FcTrue;
129
	return FcTrue;
130
130
131
    if (config)
131
    if (config)
132
	dir = FcConfigNormalizeFontDir (config, dir);
132
        FcConfigAddFontDir (config, dir);
133
134
    /* refuse to scan a directory that can't be normalized. */
135
    if (!dir)
136
	return FcFalse;
137
133
138
    if (!force)
134
    if (!force)
139
    {
135
    {

Return to bug 148693