aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-04-23 19:21:41 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-05-10 16:24:03 +0200
commitdfb5602a662507373321a1b1497311027dafdc93 (patch)
treedd662f3b50d5516590f7825547c35b946ce881a3
parent8029141e772568872e668cfb1df9b5a7968d2236 (diff)
downloadnx-libs-dfb5602a662507373321a1b1497311027dafdc93.tar.gz
nx-libs-dfb5602a662507373321a1b1497311027dafdc93.tar.bz2
nx-libs-dfb5602a662507373321a1b1497311027dafdc93.zip
Font.c: Let dix check if a font path exists
Dix will only add font paths that are existing on the system. There's no need to check that ourselves.
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Font.c54
1 files changed, 24 insertions, 30 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c
index 8c1cb7269..6fb6c8f35 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Font.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c
@@ -1433,45 +1433,39 @@ static Bool nxagentGetFontServerPath(char * fontServerPath, int size)
void nxagentVerifySingleFontPath(char **dest, const char *fontDir)
{
- struct stat dirStat;
-
if (!dest || !*dest)
return;
- if (stat(fontDir, &dirStat) == 0 &&
- S_ISDIR(dirStat.st_mode) != 0)
- {
- #ifdef TEST
- fprintf(stderr, "%s: Assuming fonts in directory [%s].\n", __func__,
- validateString(fontDir));
- #endif
+ #ifdef TEST
+ fprintf(stderr, "%s: Assuming fonts in directory [%s].\n", __func__,
+ validateString(fontDir));
+ #endif
- for (int i = 0; ; i++)
- {
- char *tmppath = NULL;
- int rc;
+ for (int i = 0; ; i++)
+ {
+ char *tmppath = NULL;
+ int rc;
- const char *subdir = nxagentFontSubdirs[i];
+ const char *subdir = nxagentFontSubdirs[i];
- if (subdir == NULL)
- return;
+ if (subdir == NULL)
+ return;
- if (**dest != '\0')
- {
- rc = asprintf(&tmppath, "%s,%s/%s", *dest, fontDir, subdir);
- }
- else
- {
- rc = asprintf(&tmppath, "%s/%s", fontDir, subdir);
- }
+ if (**dest != '\0')
+ {
+ rc = asprintf(&tmppath, "%s,%s/%s", *dest, fontDir, subdir);
+ }
+ else
+ {
+ rc = asprintf(&tmppath, "%s/%s", fontDir, subdir);
+ }
- if (rc == -1)
- return;
+ if (rc == -1)
+ return;
- free(*dest);
- *dest = tmppath;
- tmppath = NULL;
- }
+ free(*dest);
+ *dest = tmppath;
+ tmppath = NULL;
}
}