2014-10-29 12:34:46 +00:00
|
|
|
Allow BusyBox to be invoked as "<something>-busybox". This is
|
|
|
|
necessary when it's run from the Nix store as <hash>-busybox during
|
|
|
|
stdenv bootstrap.
|
2018-01-07 21:50:23 +00:00
|
|
|
--- a/libbb/appletlib.c
|
|
|
|
+++ b/libbb/appletlib.c
|
|
|
|
@@ -947,7 +947,7 @@ void FAST_FUNC run_applet_no_and_exit(int applet_no, const char *name, char **ar
|
2017-01-03 13:40:32 +00:00
|
|
|
static NORETURN void run_applet_and_exit(const char *name, char **argv)
|
|
|
|
{
|
|
|
|
# if ENABLE_BUSYBOX
|
2016-09-25 07:35:12 +01:00
|
|
|
- if (is_prefixed_with(name, "busybox"))
|
2014-10-29 12:34:46 +00:00
|
|
|
+ if (strstr(name, "busybox") != 0)
|
2018-01-07 21:50:23 +00:00
|
|
|
exit(busybox_main(/*unused:*/ 0, argv));
|
2017-01-03 13:40:32 +00:00
|
|
|
# endif
|
|
|
|
# if NUM_APPLETS > 0
|
2018-01-07 21:50:23 +00:00
|
|
|
@@ -1045,7 +1045,7 @@ int main(int argc UNUSED_PARAM, char **argv)
|
|
|
|
|
2016-12-03 19:57:46 +00:00
|
|
|
lbb_prepare("busybox" IF_FEATURE_INDIVIDUAL(, argv));
|
|
|
|
# if !ENABLE_BUSYBOX
|
|
|
|
- if (argv[1] && is_prefixed_with(bb_basename(argv[0]), "busybox"))
|
|
|
|
+ if (argv[1] && strstr(bb_basename(argv[0]), "busybox") != 0)
|
|
|
|
argv++;
|
|
|
|
# endif
|
|
|
|
applet_name = argv[0];
|