ndk-box-kitchen/patches/0017-Allow-running-as-libbusybox.so.patch
2024-10-06 01:43:13 -07:00

29 lines
807 B
Diff

From db77b8eeb81ae01685aeb3e45a9ceb4b214e39ca Mon Sep 17 00:00:00 2001
From: topjohnwu <topjohnwu@gmail.com>
Date: Thu, 21 Jan 2021 00:07:41 -0800
Subject: [PATCH 17/18] Allow running as libbusybox.so
---
libbb/appletlib.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index d5335d353..460ce823f 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -1104,7 +1104,10 @@ int main(int argc UNUSED_PARAM, char **argv)
if (argv[1] && is_prefixed_with(bb_basename(argv[0]), "busybox"))
argv++;
# endif
- applet_name = argv[0];
+ if (is_suffixed_with(argv[0], "busybox.so"))
+ applet_name = "busybox";
+ else
+ applet_name = argv[0];
if (applet_name[0] == '-')
applet_name++;
applet_name = bb_basename(applet_name);
--
2.46.0