]>
Commit | Line | Data |
---|---|---|
9298a941 JB |
1 | --- fontconfig-2.2.98/src/fcdir.c.orig 2004-12-06 20:25:19.000000000 +0100 |
2 | +++ fontconfig-2.2.98/src/fcdir.c 2005-01-22 21:26:06.141980024 +0100 | |
3 | @@ -166,6 +166,40 @@ | |
4 | return FcFileScanConfig (set, dirs, cache, blanks, file, force, 0); | |
f8e2cc6b AM |
5 | } |
6 | ||
7 | +static FcBool | |
8 | +FcBlackListed (const char *name) | |
9 | +{ | |
10 | + static const char * const black_listed_names[] = { | |
11 | + "hrger.pfa", | |
12 | + "hrgrr.pfa", | |
13 | + "hritr.pfa", | |
14 | + "hrpld.pfa", | |
15 | + "hrpldi.pfa", | |
16 | + "hrplt.pfa", | |
17 | + "hrplti.pfa", | |
18 | + "hrscc.pfa", | |
19 | + "hrscs.pfa", | |
20 | + "u003043t.gsf", | |
21 | + "u004006t.gsf" | |
22 | + }; | |
23 | + | |
24 | + int low = 0; | |
25 | + int high = sizeof(black_listed_names) / sizeof(black_listed_names[0]) - 1; | |
26 | + | |
27 | + while (low <= high) { | |
28 | + int mid = (low + high) / 2; | |
29 | + int res = strcmp (name, black_listed_names[mid]); | |
30 | + if (res == 0) | |
31 | + return FcTrue; | |
32 | + else if (res < 0) | |
33 | + high = mid - 1; | |
34 | + else | |
35 | + low = mid + 1; | |
36 | + } | |
37 | + | |
38 | + return FcFalse; | |
39 | +} | |
40 | + | |
ca6c7a71 | 41 | /* |
9298a941 JB |
42 | * Scan 'dir', adding font files to 'set' and |
43 | * subdirectories to 'dirs' | |
44 | @@ -232,7 +266,8 @@ | |
f8e2cc6b AM |
45 | } |
46 | while (ret && (e = readdir (d))) | |
47 | { | |
48 | - if (e->d_name[0] != '.' && strlen (e->d_name) < FC_MAX_FILE_LEN) | |
49 | + if (e->d_name[0] != '.' && strlen (e->d_name) < FC_MAX_FILE_LEN && | |
50 | + !FcBlackListed (e->d_name)) | |
51 | { | |
52 | strcpy ((char *) base, (char *) e->d_name); | |
9298a941 | 53 | ret = FcFileScanConfig (set, dirs, cache, blanks, file, force, config); |