projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
-fixing
[oweals/gnunet.git]
/
src
/
util
/
os_installation.c
diff --git
a/src/util/os_installation.c
b/src/util/os_installation.c
index c520c6f79450f6a0ec864be600a98f50bb97221f..035259ff6b234e1d0305044b51222fd2f4380cb1 100644
(file)
--- a/
src/util/os_installation.c
+++ b/
src/util/os_installation.c
@@
-65,7
+65,7
@@
get_path_from_proc_maps ()
while (NULL != fgets (line, sizeof (line), f))
{
if ((1 ==
while (NULL != fgets (line, sizeof (line), f))
{
if ((1 ==
- SSCANF (line, "%*x-%*x %*c%*c%*c%*c %*x %*2u:%*2u %*u%*[ ]%s", dir)) &&
+ SSCANF (line, "%*x-%*x %*c%*c%*c%*c %*x %*2u:%*2u %*u%*[ ]%
1023
s", dir)) &&
(NULL != (lgu = strstr (dir, "libgnunetutil"))))
{
lgu[0] = '\0';
(NULL != (lgu = strstr (dir, "libgnunetutil"))))
{
lgu[0] = '\0';
@@
-101,6
+101,11
@@
get_path_from_proc_exe ()
lnk[size] = '\0';
while ((lnk[size] != '/') && (size > 0))
size--;
lnk[size] = '\0';
while ((lnk[size] != '/') && (size > 0))
size--;
+ /* test for being in lib/gnunet/libexec/ */
+ if ( (size > strlen ("/gnunet/libexec/")) &&
+ (0 == strcmp ("/gnunet/libexec/",
+ &lnk[size - strlen ("/gnunet/libexec/")])) )
+ size -= strlen ("gnunet/libexec/");
if ((size < 4) || (lnk[size - 4] != '/'))
{
/* not installed in "/bin/" -- binary path probably useless */
if ((size < 4) || (lnk[size - 4] != '/'))
{
/* not installed in "/bin/" -- binary path probably useless */
@@
-568,6
+573,8
@@
GNUNET_OS_get_libexec_binary_path (const char *progname)
char *libexecdir;
char *binary;
char *libexecdir;
char *binary;
+ if (DIR_SEPARATOR == progname[0])
+ return GNUNET_strdup (progname);
libexecdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBEXECDIR);
if (NULL == libexecdir)
return GNUNET_strdup (progname);
libexecdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBEXECDIR);
if (NULL == libexecdir)
return GNUNET_strdup (progname);