aboutsummaryrefslogtreecommitdiff
path: root/src/util/os_installation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-07-07 16:13:46 +0000
committerChristian Grothoff <christian@grothoff.org>2011-07-07 16:13:46 +0000
commita9ca56c2e31d5cc988e0bfc1db8ee9217e831daa (patch)
treeaba4933c8536fb23c99a12666b483dc22e58fded /src/util/os_installation.c
parent9e7b81a3cbc81c555811c2a9386e340570612f36 (diff)
downloadgnunet-a9ca56c2e31d5cc988e0bfc1db8ee9217e831daa.tar.gz
gnunet-a9ca56c2e31d5cc988e0bfc1db8ee9217e831daa.zip
fix
Diffstat (limited to 'src/util/os_installation.c')
-rw-r--r--src/util/os_installation.c16
1 files 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)
214 return NULL; 214 return NULL;
215 path = GNUNET_strdup (p); /* because we write on it */ 215 path = GNUNET_strdup (p); /* because we write on it */
216 buf = GNUNET_malloc (strlen (path) + 20); 216 buf = GNUNET_malloc (strlen (path) + 20);
217 pos = path; 217 pos = path;
218
219 while (NULL != (end = strchr (pos, PATH_SEPARATOR))) 218 while (NULL != (end = strchr (pos, PATH_SEPARATOR)))
220 { 219 {
221 *end = '\0'; 220 *end = '\0';
@@ -453,15 +452,28 @@ GNUNET_OS_check_helper_binary (const char *binary)
453{ 452{
454 struct stat statbuf; 453 struct stat statbuf;
455 char *p; 454 char *p;
455 char *pf;
456#ifdef MINGW 456#ifdef MINGW
457 SOCKET rawsock; 457 SOCKET rawsock;
458 char *binaryexe; 458 char *binaryexe;
459 459
460 GNUNET_asprintf (&binaryexe, "%s.exe", binary); 460 GNUNET_asprintf (&binaryexe, "%s.exe", binary);
461 p = get_path_from_PATH (binaryexe); 461 p = get_path_from_PATH (binaryexe);
462 if (p != NULL)
463 {
464 GNUNET_asprintf (&pf, "%s/%s", p, binaryexe);
465 GNUNET_free (p);
466 p = pf;
467 }
462 free (binaryexe); 468 free (binaryexe);
463#else 469#else
464 p = get_path_from_PATH (binary); 470 p = get_path_from_PATH (binary);
471 if (p != NULL)
472 {
473 GNUNET_asprintf (&pf, "%s/%s", p, binary);
474 GNUNET_free (p);
475 p = pf;
476 }
465#endif 477#endif
466 if (p == NULL) 478 if (p == NULL)
467 { 479 {