libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit 5224b82ae4c58fd97074924b8c386ac3e2122e56
parent f1c8494304cbc27ae4e4e293c12576783fd27e86
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat,  6 Oct 2012 13:25:58 +0000

-fixing #2562

Diffstat:
MChangeLog | 4++++
Mconfigure.ac | 4++--
Msrc/main/extractor_plugpath.c | 16++++++++++++++--
3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,7 @@ +Sat Oct 6 15:24:20 CEST 2012 + Fixing installation path discovery on Darwin (#2562). + Releasing GNU libextractor 1.0.1. -CG + Tue Sep 25 16:25:05 CEST 2012 Releasing GNU libextractor 1.0.0. -CG diff --git a/configure.ac b/configure.ac @@ -1,6 +1,6 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([libextractor], [1.0.0], [bug-libextractor@gnu.org]) +AC_INIT([libextractor], [1.0.1], [bug-libextractor@gnu.org]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) AH_TOP([#define _GNU_SOURCE 1]) @@ -9,7 +9,7 @@ AC_CANONICAL_HOST AC_CANONICAL_SYSTEM LIB_VERSION_CURRENT=4 -LIB_VERSION_REVISION=0 +LIB_VERSION_REVISION=1 LIB_VERSION_AGE=1 AC_SUBST(LIB_VERSION_CURRENT) AC_SUBST(LIB_VERSION_REVISION) diff --git a/src/main/extractor_plugpath.c b/src/main/extractor_plugpath.c @@ -215,6 +215,7 @@ get_path_from_NSGetExecutablePath () { static char zero; char *path; + char *ret; size_t len; MyNSGetExecutablePathProto func; @@ -243,7 +244,17 @@ get_path_from_NSGetExecutablePath () while ((path[len] != '/') && (len > 0)) len--; path[len] = '\0'; - return path; + if (NULL != strstr (path, "/lib")) + return path; + path = cut_bin (path); + if (NULL == (ret = realloc (path, strlen (path) + 5))) + { + LOG_STRERROR ("realloc"); + free (path); + return NULL; + } + strcat (ret, "/lib/"); + return ret; } @@ -293,7 +304,8 @@ get_path_from_dyld_image () * @return path to binary, NULL if not found */ static char * -get_path_from_PATH() { +get_path_from_PATH() +{ struct stat sbuf; char *path; char *pos;