From: Christian Grothoff Date: Wed, 13 Jun 2012 11:23:22 +0000 (+0000) Subject: -LRN: fix r21946 to work on W32 X-Git-Tag: initial-import-from-subversion-38251~13094 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=16f659aedbacb16d2861ac08b832d2336e583117;p=oweals%2Fgnunet.git -LRN: fix r21946 to work on W32 --- diff --git a/src/util/os_installation.c b/src/util/os_installation.c index e42986173..c44f741f4 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c @@ -216,8 +216,13 @@ get_path_from_PATH (const char *binary) p = getenv ("PATH"); if (NULL == p) return NULL; +#if WINDOWS + /* On W32 look in CWD first. */ + GNUNET_asprintf (&path, ".%c%s", PATH_SEPARATOR, p); +#else path = GNUNET_strdup (p); /* because we write on it */ - buf = GNUNET_malloc (strlen (path) + 20); +#endif + buf = GNUNET_malloc (strlen (path) + strlen (binary) + 1 + 1); pos = path; while (NULL != (end = strchr (pos, PATH_SEPARATOR))) {