forked from old/legacy-imlib2
Fixed imlib_list_fonts()
It was calling stat on filenames without paths, so that was failing. SVN revision: 3064
This commit is contained in:
parent
c465599b95
commit
b257c14d76
10
src/font.c
10
src/font.c
|
@ -776,16 +776,13 @@ __imlib_list_fonts(int *num_ret)
|
||||||
{
|
{
|
||||||
for (j = 0; j < d; j++)
|
for (j = 0; j < d; j++)
|
||||||
{
|
{
|
||||||
if (__imlib_FileIsFile(dir[j]))
|
path = malloc(strlen(fpath[i]) + strlen(dir[j]) + 2);
|
||||||
|
sprintf(path, "%s/%s", fpath[i], dir[j]);
|
||||||
|
if (__imlib_FileIsFile(path))
|
||||||
{
|
{
|
||||||
TT_Face f;
|
TT_Face f;
|
||||||
|
|
||||||
path = malloc(strlen(fpath[i]) + 1 + strlen(dir[j]) + 1);
|
|
||||||
strcpy(path, fpath[i]);
|
|
||||||
strcat(path, "/");
|
|
||||||
strcat(path, dir[j]);
|
|
||||||
error = TT_Open_Face(engine, path, &f);
|
error = TT_Open_Face(engine, path, &f);
|
||||||
free(path);
|
|
||||||
if (!error)
|
if (!error)
|
||||||
{
|
{
|
||||||
TT_Close_Face(f);
|
TT_Close_Face(f);
|
||||||
|
@ -798,6 +795,7 @@ __imlib_list_fonts(int *num_ret)
|
||||||
}
|
}
|
||||||
free(dir[j]);
|
free(dir[j]);
|
||||||
}
|
}
|
||||||
|
free(path);
|
||||||
}
|
}
|
||||||
free(dir);
|
free(dir);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue