Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 679715925e965bb2a6eb2a4e20fe9b0e > files > 1

libxfont-1.3.0-3.1mdv2008.0.src.rpm

From 0b6102f26a1ee1c82cd0699afa5a8975a10572e7 Mon Sep 17 00:00:00 2001
From: Ademar de Souza Reis Jr <ademar@mandriva.com.br>
Date: Tue, 10 Jul 2007 14:18:36 -0300
Subject: [PATCH] support relative paths in catalogue:<dir> symlinks

---
 src/fontfile/catalogue.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/fontfile/catalogue.c b/src/fontfile/catalogue.c
index 812b050..2dc3d09 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)
 	{
-- 
1.5.2.2