From a9ca56c2e31d5cc988e0bfc1db8ee9217e831daa Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 7 Jul 2011 16:13:46 +0000 Subject: [PATCH] fix --- src/util/os_installation.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/util/os_installation.c b/src/util/os_installation.c index ac5688aab..9bf260979 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c @@ -214,8 +214,7 @@ get_path_from_PATH (const char *binary) return NULL; path = GNUNET_strdup (p); /* because we write on it */ buf = GNUNET_malloc (strlen (path) + 20); - pos = path; - + pos = path; while (NULL != (end = strchr (pos, PATH_SEPARATOR))) { *end = '\0'; @@ -453,15 +452,28 @@ GNUNET_OS_check_helper_binary (const char *binary) { struct stat statbuf; char *p; + char *pf; #ifdef MINGW SOCKET rawsock; char *binaryexe; GNUNET_asprintf (&binaryexe, "%s.exe", binary); p = get_path_from_PATH (binaryexe); + if (p != NULL) + { + GNUNET_asprintf (&pf, "%s/%s", p, binaryexe); + GNUNET_free (p); + p = pf; + } free (binaryexe); #else p = get_path_from_PATH (binary); + if (p != NULL) + { + GNUNET_asprintf (&pf, "%s/%s", p, binary); + GNUNET_free (p); + p = pf; + } #endif if (p == NULL) { -- 2.25.1