From 16f659aedbacb16d2861ac08b832d2336e583117 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 13 Jun 2012 11:23:22 +0000 Subject: [PATCH] -LRN: fix r21946 to work on W32 --- src/util/os_installation.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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))) { -- 2.25.1