aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libbb.h2
-rw-r--r--include/mingw.h1
-rw-r--r--libbb/mingw.c9
3 files changed, 12 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 5f496f435..ea02a9978 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -60,6 +60,8 @@
60#include "autoconf.h" 60#include "autoconf.h"
61#ifdef __MINGW32__ 61#ifdef __MINGW32__
62#include "mingw.h" 62#include "mingw.h"
63#undef CONFIG_BUSYBOX_EXEC_PATH
64#define CONFIG_BUSYBOX_EXEC_PATH get_busybox_exec_path()
63#endif 65#endif
64 66
65#include "pwd_.h" 67#include "pwd_.h"
diff --git a/include/mingw.h b/include/mingw.h
index 3d252af5f..b39d94a33 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -248,6 +248,7 @@ char **copy_environ(void);
248void free_environ(char **env); 248void free_environ(char **env);
249char **env_setenv(char **env, const char *name); 249char **env_setenv(char **env, const char *name);
250 250
251const char *get_busybox_exec_path();
251/* 252/*
252 * A replacement of main() that ensures that argv[0] has a path 253 * A replacement of main() that ensures that argv[0] has a path
253 */ 254 */
diff --git a/libbb/mingw.c b/libbb/mingw.c
index f90fbc1d2..e3ec2782c 100644
--- a/libbb/mingw.c
+++ b/libbb/mingw.c
@@ -1280,3 +1280,12 @@ char *strptime(const char *s, const char *format, struct tm *tm)
1280void unsetenv(const char *env) 1280void unsetenv(const char *env)
1281{ 1281{
1282} 1282}
1283
1284const char *get_busybox_exec_path()
1285{
1286 static char path[PATH_MAX] = "";
1287
1288 if (!*path)
1289 GetModuleFileName(NULL, path, PATH_MAX);
1290 return path;
1291}