Commit dfb5602a authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

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.
parent 8029141e
...@@ -1433,45 +1433,39 @@ static Bool nxagentGetFontServerPath(char * fontServerPath, int size) ...@@ -1433,45 +1433,39 @@ static Bool nxagentGetFontServerPath(char * fontServerPath, int size)
void nxagentVerifySingleFontPath(char **dest, const char *fontDir) void nxagentVerifySingleFontPath(char **dest, const char *fontDir)
{ {
struct stat dirStat;
if (!dest || !*dest) if (!dest || !*dest)
return; return;
if (stat(fontDir, &dirStat) == 0 && #ifdef TEST
S_ISDIR(dirStat.st_mode) != 0) fprintf(stderr, "%s: Assuming fonts in directory [%s].\n", __func__,
{ validateString(fontDir));
#ifdef TEST #endif
fprintf(stderr, "%s: Assuming fonts in directory [%s].\n", __func__,
validateString(fontDir));
#endif
for (int i = 0; ; i++) for (int i = 0; ; i++)
{ {
char *tmppath = NULL; char *tmppath = NULL;
int rc; int rc;
const char *subdir = nxagentFontSubdirs[i]; const char *subdir = nxagentFontSubdirs[i];
if (subdir == NULL) if (subdir == NULL)
return; return;
if (**dest != '\0') if (**dest != '\0')
{ {
rc = asprintf(&tmppath, "%s,%s/%s", *dest, fontDir, subdir); rc = asprintf(&tmppath, "%s,%s/%s", *dest, fontDir, subdir);
} }
else else
{ {
rc = asprintf(&tmppath, "%s/%s", fontDir, subdir); rc = asprintf(&tmppath, "%s/%s", fontDir, subdir);
} }
if (rc == -1) if (rc == -1)
return; return;
free(*dest); free(*dest);
*dest = tmppath; *dest = tmppath;
tmppath = NULL; tmppath = NULL;
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment