aboutsummaryrefslogtreecommitdiff
path: root/mkfontscale/mkfontscale.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-01-11 08:00:45 +0100
committermarha <marha@users.sourceforge.net>2013-01-11 08:00:45 +0100
commitddc05759f098f06bd93253a7bffe38640963dfb3 (patch)
treefd0ae943233033cda2bfe50dd097532a4cf5c0b9 /mkfontscale/mkfontscale.c
parent8a26872f0c9102cb357345eca24a4bf7401bbe70 (diff)
downloadvcxsrv-ddc05759f098f06bd93253a7bffe38640963dfb3.tar.gz
vcxsrv-ddc05759f098f06bd93253a7bffe38640963dfb3.tar.bz2
vcxsrv-ddc05759f098f06bd93253a7bffe38640963dfb3.zip
fontconfig libX11 mesa mkfontscale xserver git update 11 jan 2013
fontconfig: 0831c1770e4bac7269a190936bbb0529d747e233 libX11: 0b148750027fd0557c5ed93afda861ddf4b92e0f mkfontscale: 9cbe3256bc932b82f2435b23cda0931f4f5f5ba2 xserver: 6703a7c7cf1a349c137e247a0c8eb462ff7b07be mesa: babab2876080af0fe65249dff559244aebd0b87e
Diffstat (limited to 'mkfontscale/mkfontscale.c')
-rw-r--r--mkfontscale/mkfontscale.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/mkfontscale/mkfontscale.c b/mkfontscale/mkfontscale.c
index 53c53031b..b27bb6a5d 100644
--- a/mkfontscale/mkfontscale.c
+++ b/mkfontscale/mkfontscale.c
@@ -25,6 +25,7 @@
#include <string.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>
#include <errno.h>
@@ -826,6 +827,9 @@ doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo)
while((entry = readdir(dirp)) != NULL) {
int have_face = 0;
char *xlfd_name = NULL;
+ struct stat f_stat;
+ int tprio = 1;
+
xlfd = NULL;
if (xl) {
@@ -836,6 +840,19 @@ doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo)
filename = dsprintf("%s%s", dirname, entry->d_name);
+#define PRIO(x) ((x << 1) + tprio)
+#ifdef DT_LNK
+ if (entry->d_type != DT_UNKNOWN) {
+ if (entry->d_type == DT_LNK)
+ tprio = 0;
+ } else
+#endif
+ {
+ if (lstat(filename, &f_stat))
+ goto done;
+ if (S_ISLNK(f_stat.st_mode))
+ tprio = 0;
+ }
if(doBitmaps)
rc = bitmapIdentify(filename, &xlfd_name);
else
@@ -896,7 +913,7 @@ doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo)
xlfd = listCons(s, xlfd);
} else {
/* Not a reencodable font -- skip all the rest of the loop body */
- putHash(entries, xlfd_name, entry->d_name, filePrio(entry->d_name));
+ putHash(entries, xlfd_name, entry->d_name, PRIO(filePrio(entry->d_name)));
goto done;
}
}
@@ -930,7 +947,7 @@ doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo)
found = 1;
snprintf(buf, MAXFONTNAMELEN, "%s-%s",
lp->value, encoding->value);
- putHash(entries, buf, entry->d_name, filePrio(entry->d_name));
+ putHash(entries, buf, entry->d_name, PRIO(filePrio(entry->d_name)));
}
}
for(encoding = extra_encodings; encoding;
@@ -939,7 +956,7 @@ doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo)
/* Do not set found! */
snprintf(buf, MAXFONTNAMELEN, "%s-%s",
lp->value, encoding->value);
- putHash(entries, buf, entry->d_name, filePrio(entry->d_name));
+ putHash(entries, buf, entry->d_name, PRIO(filePrio(entry->d_name)));
}
}
}
@@ -949,6 +966,7 @@ doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo)
deepDestroyList(xlfd);
xlfd = NULL;
free(filename);
+#undef PRIO
}
closedir(dirp);