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

(-)fontconfig-2.3.93.20060207.orig/src/fccache.c (-12 / +8 lines)
Lines 842-848 Link Here
842
{
842
{
843
    int			ret = 0;
843
    int			ret = 0;
844
    FcChar8		*dir;
844
    FcChar8		*dir;
845
    const FcChar8	*name;
846
    FcStrSet		*subdirs;
845
    FcStrSet		*subdirs;
847
    FcStrList		*sublist;
846
    FcStrList		*sublist;
848
    struct stat		statb;
847
    struct stat		statb;
Lines 856-871 Link Here
856
	if (!FcConfigAcceptFilename (config, dir))
855
	if (!FcConfigAcceptFilename (config, dir))
857
	    continue;
856
	    continue;
858
857
859
	/* Skip this directory if already updated
858
	/* Skip this directory if already scanned */
860
	 * to avoid the looped directories via symlinks
859
 	dir = FcConfigNormalizeFontDir (config, dir);
861
	 */
860
 	if (! dir)
862
	name = FcConfigNormalizeFontDir (config, dir);
861
 	    continue;
863
	if (name) 
862
 	if (! FcStrSetAdd (processed_dirs, dir))
864
	{
863
 	    continue;
865
	    if (FcStrSetMember (processed_dirs, dir))
864
866
		continue;
867
	    FcStrSetAdd (processed_dirs, dir);
868
	}
869
865
870
	subdirs = FcStrSetCreate ();
866
	subdirs = FcStrSetCreate ();
871
	if (!subdirs)
867
	if (!subdirs)
Lines 907-913 Link Here
907
	if (FcDirCacheValid (dir) && FcDirCacheRead (set, subdirs, dir, config))
903
	if (FcDirCacheValid (dir) && FcDirCacheRead (set, subdirs, dir, config))
908
	{
904
	{
909
	    /* if an old entry is found in the global cache, disable it */
905
	    /* if an old entry is found in the global cache, disable it */
910
	    if ((d = FcGlobalCacheDirFind (cache, (const char *)name)) != NULL)
906
	    if ((d = FcGlobalCacheDirFind (cache, (const char *)dir)) != NULL)
911
	    {
907
	    {
912
		d->state = FcGCDirDisabled;
908
		d->state = FcGCDirDisabled;
913
		/* save the updated config later without this entry */
909
		/* save the updated config later without this entry */
(-)fontconfig-2.3.93.20060207.orig/src/fccfg.c (-8 / +29 lines)
Lines 1-7 Link Here
1
/*
1
/*
2
 * $RCSId: xc/lib/fontconfig/src/fccfg.c,v 1.23 2002/08/31 22:17:32 keithp Exp $
2
 * $RCSId: xc/lib/fontconfig/src/fccfg.c,v 1.23 2002/08/31 22:17:32 keithp Exp $
3
 *
3
 *
4
 * Copyright © 2000 Keith Packard
4
 * Copyright © 2000 Keith Packard
5
 *
5
 *
6
 * Permission to use, copy, modify, distribute, and sell this software and its
6
 * Permission to use, copy, modify, distribute, and sell this software and its
7
 * documentation for any purpose is hereby granted without fee, provided that
7
 * documentation for any purpose is hereby granted without fee, provided that
Lines 419-427 Link Here
419
FcConfigAddFontDir (FcConfig	    *config,
419
FcConfigAddFontDir (FcConfig	    *config,
420
		    const FcChar8   *d)
420
		    const FcChar8   *d)
421
{
421
{
422
    /* Avoid adding d if it's an alias of something else, too. */
423
    if (FcConfigInodeMatchFontDir(config, d))
424
	return FcTrue;
425
    return FcStrSetAddFilename (config->fontDirs, d);
422
    return FcStrSetAddFilename (config->fontDirs, d);
426
}
423
}
427
424
Lines 1879-1887 Link Here
1879
    return FcTrue;
1876
    return FcTrue;
1880
}
1877
}
1881
1878
1882
FcBool
1879
static FcBool
1883
FcConfigAppFontAddDir (FcConfig	    *config,
1880
FcConfigAppFontAddDirWithCheck (FcConfig	    *config,
1884
		       const FcChar8   *dir)
1881
				const FcChar8   *dir,
1882
				FcStrSet *processed_dirs)
1885
{
1883
{
1886
    FcFontSet	*set;
1884
    FcFontSet	*set;
1887
    FcStrSet	*subdirs;
1885
    FcStrSet	*subdirs;
Lines 1915-1925 Link Here
1915
	FcStrSetDestroy (subdirs);
1913
	FcStrSetDestroy (subdirs);
1916
	return FcFalse;
1914
	return FcFalse;
1917
    }
1915
    }
1916
    FcStrSetAdd (processed_dirs, dir);
1918
    if ((sublist = FcStrListCreate (subdirs)))
1917
    if ((sublist = FcStrListCreate (subdirs)))
1919
    {
1918
    {
1920
	while ((subdir = FcStrListNext (sublist)))
1919
	while ((subdir = FcStrListNext (sublist)))
1921
	{
1920
	{
1922
	    FcConfigAppFontAddDir (config, subdir);
1921
	    FcChar8 *name;
1922
	    name = FcConfigNormalizeFontDir (config, subdir);
1923
	    if (! name)
1924
		name = subdir;
1925
	    if (! FcStrSetMember (processed_dirs, name))
1926
		FcConfigAppFontAddDirWithCheck (config, name, processed_dirs);
1923
	}
1927
	}
1924
	FcStrListDone (sublist);
1928
	FcStrListDone (sublist);
1925
    }
1929
    }
Lines 1927-1932 Link Here
1927
    return FcTrue;
1931
    return FcTrue;
1928
}
1932
}
1929
1933
1934
FcBool
1935
FcConfigAppFontAddDir (FcConfig	    *config,
1936
		       const FcChar8   *dir)
1937
{
1938
    FcStrSet *processed_dirs;
1939
    FcBool res;
1940
1941
    processed_dirs = FcStrSetCreate ();
1942
    if (! processed_dirs)
1943
	return FcFalse;
1944
1945
    res = FcConfigAppFontAddDirWithCheck (config, dir, processed_dirs);
1946
    FcStrSetDestroy (processed_dirs);
1947
1948
    return res;
1949
}
1950
1930
void
1951
void
1931
FcConfigAppFontClear (FcConfig	    *config)
1952
FcConfigAppFontClear (FcConfig	    *config)
1932
{
1953
{
(-)fontconfig-2.3.93.20060207.orig/src/fcdir.c (-5 / +1 lines)
Lines 129-139 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