diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-23 03:54:15 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-23 04:44:34 +1000 |
commit | dacd447d415591d6b2dbe746b93bcc6fb07abe8e (patch) | |
tree | c59b38911cdd31ce560029c8a09eec6f77134f68 | |
parent | 2ef16e4999761216c4c067c1487246a347a2ab84 (diff) | |
download | busybox-w32-dacd447d415591d6b2dbe746b93bcc6fb07abe8e.tar.gz busybox-w32-dacd447d415591d6b2dbe746b93bcc6fb07abe8e.tar.bz2 busybox-w32-dacd447d415591d6b2dbe746b93bcc6fb07abe8e.zip |
redefine CONFIG_BUSYBOX_EXEC_PATH to get full path
-rw-r--r-- | include/libbb.h | 2 | ||||
-rw-r--r-- | include/mingw.h | 1 | ||||
-rw-r--r-- | libbb/mingw.c | 9 |
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); | |||
248 | void free_environ(char **env); | 248 | void free_environ(char **env); |
249 | char **env_setenv(char **env, const char *name); | 249 | char **env_setenv(char **env, const char *name); |
250 | 250 | ||
251 | const 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) | |||
1280 | void unsetenv(const char *env) | 1280 | void unsetenv(const char *env) |
1281 | { | 1281 | { |
1282 | } | 1282 | } |
1283 | |||
1284 | const 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 | } | ||