diff options
-rw-r--r-- | include/libbb.h | 10 | ||||
-rw-r--r-- | libbb/appletlib.c | 13 |
2 files changed, 11 insertions, 12 deletions
diff --git a/include/libbb.h b/include/libbb.h index a3611abc3..a7b19b1c9 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1327,13 +1327,13 @@ void run_noexec_applet_and_exit(int a, const char *name, char **argv) NORETURN F | |||
1327 | #ifndef BUILD_INDIVIDUAL | 1327 | #ifndef BUILD_INDIVIDUAL |
1328 | int find_applet_by_name(const char *name) FAST_FUNC; | 1328 | int find_applet_by_name(const char *name) FAST_FUNC; |
1329 | void run_applet_no_and_exit(int a, const char *name, char **argv) NORETURN FAST_FUNC; | 1329 | void run_applet_no_and_exit(int a, const char *name, char **argv) NORETURN FAST_FUNC; |
1330 | # if ENABLE_PLATFORM_MINGW32 && \ | 1330 | # if ENABLE_PLATFORM_MINGW32 |
1331 | (ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE) | 1331 | # if ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE |
1332 | int is_applet_preferred(const char *name, const char *path) FAST_FUNC; | 1332 | int is_applet_preferred(const char *name, const char *path) FAST_FUNC; |
1333 | int find_applet_by_name_with_path(const char *name, const char *path) FAST_FUNC; | 1333 | int find_applet_by_name_with_path(const char *name, const char *path) FAST_FUNC; |
1334 | # else | 1334 | # else |
1335 | # define is_applet_preferred(n, p) (1) | 1335 | # define is_applet_preferred(n, p) (1) |
1336 | # define find_applet_by_name_with_path(n, p) find_applet_by_name(n) | 1336 | # endif |
1337 | # endif | 1337 | # endif |
1338 | #endif | 1338 | #endif |
1339 | void show_usage_if_dash_dash_help(int applet_no, char **argv) FAST_FUNC; | 1339 | void show_usage_if_dash_dash_help(int applet_no, char **argv) FAST_FUNC; |
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 5cd2bbcc2..34082ad94 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -100,7 +100,8 @@ static const char packed_scripts[] ALIGN1 = { PACKED_SCRIPTS }; | |||
100 | # define ENABLE_FEATURE_COMPRESS_USAGE 0 | 100 | # define ENABLE_FEATURE_COMPRESS_USAGE 0 |
101 | #endif | 101 | #endif |
102 | 102 | ||
103 | #if ENABLE_PLATFORM_MINGW32 | 103 | #if ENABLE_PLATFORM_MINGW32 && NUM_APPLETS > 1 && \ |
104 | (ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE) | ||
104 | static int really_find_applet_by_name(const char *name); | 105 | static int really_find_applet_by_name(const char *name); |
105 | #else | 106 | #else |
106 | #define really_find_applet_by_name(n) find_applet_by_name(n) | 107 | #define really_find_applet_by_name(n) find_applet_by_name(n) |
@@ -194,7 +195,8 @@ void FAST_FUNC bb_show_usage(void) | |||
194 | xfunc_die(); | 195 | xfunc_die(); |
195 | } | 196 | } |
196 | 197 | ||
197 | #if ENABLE_PLATFORM_MINGW32 | 198 | #if ENABLE_PLATFORM_MINGW32 && NUM_APPLETS > 1 && \ |
199 | (ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE) | ||
198 | static int really_find_applet_by_name(const char *name) | 200 | static int really_find_applet_by_name(const char *name) |
199 | #else | 201 | #else |
200 | int FAST_FUNC find_applet_by_name(const char *name) | 202 | int FAST_FUNC find_applet_by_name(const char *name) |
@@ -263,8 +265,8 @@ int FAST_FUNC find_applet_by_name(const char *name) | |||
263 | return -1; | 265 | return -1; |
264 | } | 266 | } |
265 | 267 | ||
266 | #if ENABLE_PLATFORM_MINGW32 | 268 | #if ENABLE_PLATFORM_MINGW32 && NUM_APPLETS > 1 && \ |
267 | # undef find_applet_by_name_with_path | 269 | (ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE) |
268 | int FAST_FUNC find_applet_by_name_with_path(const char *name, const char *path) | 270 | int FAST_FUNC find_applet_by_name_with_path(const char *name, const char *path) |
269 | { | 271 | { |
270 | int applet_no = really_find_applet_by_name(name); | 272 | int applet_no = really_find_applet_by_name(name); |
@@ -275,10 +277,7 @@ int FAST_FUNC find_applet_by_name(const char *name) | |||
275 | { | 277 | { |
276 | return find_applet_by_name_with_path(name, NULL); | 278 | return find_applet_by_name_with_path(name, NULL); |
277 | } | 279 | } |
278 | #endif | ||
279 | 280 | ||
280 | #if ENABLE_PLATFORM_MINGW32 && NUM_APPLETS > 1 && \ | ||
281 | (ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE) | ||
282 | static int external_exists(const char *name, const char *path) | 281 | static int external_exists(const char *name, const char *path) |
283 | { | 282 | { |
284 | char *path1 = xstrdup(path ?: getenv("PATH")); | 283 | char *path1 = xstrdup(path ?: getenv("PATH")); |