-LRN: fix r21946 to work on W32
authorChristian Grothoff <christian@grothoff.org>
Wed, 13 Jun 2012 11:23:22 +0000 (11:23 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 13 Jun 2012 11:23:22 +0000 (11:23 +0000)
src/util/os_installation.c

index e4298617323fa422d9c00d30522700e9afaa8764..c44f741f42c67e02817bed8a59209f85405e3425 100644 (file)
@@ -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)))
   {