diff options
-rw-r--r-- | include/libbb.h | 4 | ||||
-rw-r--r-- | libbb/messages.c | 4 | ||||
-rw-r--r-- | win32/mingw.c | 9 |
3 files changed, 17 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 0933f5385..11d7f27d3 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1562,7 +1562,11 @@ extern const char bb_path_group_file[]; | |||
1562 | extern const char bb_path_motd_file[]; | 1562 | extern const char bb_path_motd_file[]; |
1563 | extern const char bb_path_wtmp_file[]; | 1563 | extern const char bb_path_wtmp_file[]; |
1564 | extern const char bb_dev_null[]; | 1564 | extern const char bb_dev_null[]; |
1565 | #if ENABLE_PLATFORM_MINGW32 | ||
1566 | #define bb_busybox_exec_path get_busybox_exec_path() | ||
1567 | #else | ||
1565 | extern const char bb_busybox_exec_path[]; | 1568 | extern const char bb_busybox_exec_path[]; |
1569 | #endif | ||
1566 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, | 1570 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, |
1567 | * but I want to save a few bytes here */ | 1571 | * but I want to save a few bytes here */ |
1568 | extern const char bb_PATH_root_path[]; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */ | 1572 | extern const char bb_PATH_root_path[]; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */ |
diff --git a/libbb/messages.c b/libbb/messages.c index 07b522bf4..ffa8d00cd 100644 --- a/libbb/messages.c +++ b/libbb/messages.c | |||
@@ -44,7 +44,11 @@ const char bb_path_group_file[] ALIGN1 = "/etc/group"; | |||
44 | const char bb_path_gshadow_file[] ALIGN1 = "/etc/gshadow"; | 44 | const char bb_path_gshadow_file[] ALIGN1 = "/etc/gshadow"; |
45 | const char bb_path_motd_file[] ALIGN1 = "/etc/motd"; | 45 | const char bb_path_motd_file[] ALIGN1 = "/etc/motd"; |
46 | const char bb_dev_null[] ALIGN1 = "/dev/null"; | 46 | const char bb_dev_null[] ALIGN1 = "/dev/null"; |
47 | #if ENABLE_PLATFORM_MINGW32 | ||
48 | /* bb_busybox_exec_path is redefined to get_busybox_exec_path() in libbb.h */ | ||
49 | #else | ||
47 | const char bb_busybox_exec_path[] ALIGN1 = CONFIG_BUSYBOX_EXEC_PATH; | 50 | const char bb_busybox_exec_path[] ALIGN1 = CONFIG_BUSYBOX_EXEC_PATH; |
51 | #endif | ||
48 | const char bb_default_login_shell[] ALIGN1 = LIBBB_DEFAULT_LOGIN_SHELL; | 52 | const char bb_default_login_shell[] ALIGN1 = LIBBB_DEFAULT_LOGIN_SHELL; |
49 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, | 53 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, |
50 | * but I want to save a few bytes here. Check libbb.h before changing! */ | 54 | * but I want to save a few bytes here. Check libbb.h before changing! */ |
diff --git a/win32/mingw.c b/win32/mingw.c index b879bfbae..57573bf60 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -372,3 +372,12 @@ char *realpath(const char *path, char *resolved_path) | |||
372 | /* FIXME: need normalization */ | 372 | /* FIXME: need normalization */ |
373 | return strcpy(resolved_path, path); | 373 | return strcpy(resolved_path, path); |
374 | } | 374 | } |
375 | |||
376 | const char *get_busybox_exec_path(void) | ||
377 | { | ||
378 | static char path[PATH_MAX] = ""; | ||
379 | |||
380 | if (!*path) | ||
381 | GetModuleFileName(NULL, path, PATH_MAX); | ||
382 | return path; | ||
383 | } | ||