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)
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;
}
}
......
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