[Fontconfig] fontconfig: Branch 'master'

Akira TAGOH tagoh at kemper.freedesktop.org
Wed Jan 16 19:49:20 PST 2013


 configure.ac    |    2 +-
 src/fcdefault.c |   14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 671bcb34e23ed03b1f564af35560db81f8b12b96
Author: Akira TAGOH <akira at tagoh.org>
Date:   Thu Jan 17 12:49:16 2013 +0900

    Better fix for 2fe5ddfd
    
    Drop realpath() and fix breakage on Win32

diff --git a/configure.ac b/configure.ac
index 91875b1..e8ee559 100644
--- a/configure.ac
+++ b/configure.ac
@@ -141,7 +141,7 @@ AC_TYPE_PID_T
 # Checks for library functions.
 AC_FUNC_VPRINTF
 AC_FUNC_MMAP
-AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s getopt getopt_long getprogname rand random lrand48 random_r rand_r realpath regcomp regerror regexec regfree fstatvfs fstatfs lstat])
+AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s getopt getopt_long getprogname rand random lrand48 random_r rand_r regcomp regerror regexec regfree fstatvfs fstatfs lstat])
 
 dnl AC_CHECK_FUNCS doesn't check for header files.
 dnl posix_fadvise() may be not available in older libc.
diff --git a/src/fcdefault.c b/src/fcdefault.c
index 2d7c4f7..b1bd9cc 100644
--- a/src/fcdefault.c
+++ b/src/fcdefault.c
@@ -140,23 +140,23 @@ retry:
 
 	    prgname = FcStrdup (p);
 	}
+#elif defined (HAVE_GETPROGNAME)
+	const char *q = getprogname ();
+	if (q)
+	    prgname = FcStrdup (q);
+	else
+	    prgname = FcStrdup ("");
 #else
 	char buf[PATH_MAX + 1];
 	unsigned int len;
 	char *p = NULL;
 
-#if defined (HAVE_GETPROGNAME) && defined (HAVE_REALPATH)
-	const char *q = getprogname ();
-	if (q)
-	    p = realpath (q, buf);
-#else
 	len = readlink ("/proc/self/exe", buf, sizeof (buf) - 1);
 	if (len > 0)
 	{
 	    buf[len] = '\0';
 	    p = buf;
 	}
-#endif
 
 	if (p)
 	{
@@ -171,12 +171,12 @@ retry:
 
 	if (!prgname)
 	    prgname = FcStrdup ("");
+#endif
 
 	if (!fc_atomic_ptr_cmpexch (&default_prgname, NULL, prgname)) {
 	    free (prgname);
 	    goto retry;
 	}
-#endif
     }
 
     if (prgname && !prgname[0])


More information about the Fontconfig mailing list