Akira TAGOH wrote:
configure.ac | 2 +-
src/fcdefault.c | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
New commits:
commit f9ac4c84c90cbb57afbf1fa3a5c9ff3bfc4f537e
Author: Akira TAGOH <akira@xxxxxxxxx>
Date: Wed Jan 16 16:35:28 2013 +0900
Improve FcGetPrgname() to work on BSD
[...]
Who would've guessed, Solaris has yet another API for that sort of thing.
Attached is a small change that worked for me. I folded it into the
Linux part to reuse the basename extraction code.
Raimund
--
Worringer Str 31 Duesseldorf 40211 DE home: <rs@xxxxxxxx>
+49-179-2981632 icq 16845346 work: <rs@xxxxxxxxxxxxxxx>
diff --git a/configure.ac b/configure.ac
index e8ee559..f8a41c9 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 regcomp regerror regexec regfree fstatvfs fstatfs lstat])
+AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s getopt getopt_long getprogname getexecname 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 d1217a4..d1b917f 100644
--- a/src/fcdefault.c
+++ b/src/fcdefault.c
@@ -147,6 +147,9 @@ retry:
else
prgname = FcStrdup ("");
#else
+# if defined (HAVE_GETEXECNAME)
+ const char *p = getexecname ();
+# else
char buf[PATH_MAX + 1];
int len;
char *p = NULL;
@@ -157,7 +160,7 @@ retry:
buf[len] = '\0';
p = buf;
}
-
+# endif
if (p)
{
char *r = strrchr (p, '/');
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig