From: Christian Grothoff Date: Thu, 7 Jul 2011 16:13:46 +0000 (+0000) Subject: fix X-Git-Tag: initial-import-from-subversion-38251~17945 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a9ca56c2e31d5cc988e0bfc1db8ee9217e831daa;p=oweals%2Fgnunet.git fix --- 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) {