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%*[ ]%1023s", dir)) &&
(NULL != (lgu = strstr (dir, "libgnunetutil"))))
{
lgu[0] = '\0';
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 */
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);