summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdemar de Souza Reis Jr <ademar@mandriva.com.br>2007-07-30 14:35:01 -0400
committerKristian Høgsberg <krh@redhat.com>2007-07-30 14:35:01 -0400
commit0a5b31a40c4933f4c69157c61d4d4890af2205b1 (patch)
treefc29d6ff629be1c7db2c28c7bd72f689385dba32
parente3642d9b2c0819a607d4cce413b9f0541285545b (diff)
Support relative paths in catalogue:<dir> symlinks.
Relative symlinks are common inside the catalogue directory and should be supported as well.
-rw-r--r--src/fontfile/catalogue.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/fontfile/catalogue.c b/src/fontfile/catalogue.c
index 812b050..8168ffd 100644
--- a/src/fontfile/catalogue.c
+++ b/src/fontfile/catalogue.c
@@ -136,6 +136,7 @@ CatalogueRescan (FontPathElementPtr fpe)
DIR *dir;
struct dirent *entry;
int len;
+ int pathlen;
path = fpe->name + strlen(CataloguePrefix);
if (stat(path, &statbuf) < 0 || !S_ISDIR(statbuf.st_mode))
@@ -159,6 +160,17 @@ CatalogueRescan (FontPathElementPtr fpe)
if (len < 0)
continue;
+ dest[len] = '\0';
+
+ if (dest[0] != '/')
+ {
+ pathlen = strlen(path);
+ memmove(dest + pathlen + 1, dest, sizeof dest - pathlen - 1);
+ memcpy(dest, path, pathlen);
+ memcpy(dest + pathlen, "/", 1);
+ len += pathlen + 1;
+ }
+
attrib = strchr(link, ':');
if (attrib && len + strlen(attrib) < sizeof dest)
{