summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko2018-11-01 10:28:04 +0100
committerDenys Vlasenko2018-11-01 10:28:04 +0100
commitaa2959c90d9c3217ddb6f482b82fef7234ad9bde (patch)
tree2acd656bf9936d20102817256ad6ed87d7084894 /libbb
parent4f2ef4a836be37b25808c94f41c7c85895db6f93 (diff)
downloadbusybox-aa2959c90d9c3217ddb6f482b82fef7234ad9bde.zip
busybox-aa2959c90d9c3217ddb6f482b82fef7234ad9bde.tar.gz
claenups for previous commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/appletlib.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 0872008..4e6d1c3 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -964,6 +964,22 @@ void FAST_FUNC run_applet_no_and_exit(int applet_no, const char *name, char **ar
# endif /* NUM_APPLETS > 0 */
# if NUM_SCRIPTS > 0
+static int
+find_script_by_name(const char *arg)
+{
+ const char *s = script_names;
+ int i = 0;
+
+ while (*s) {
+ if (strcmp(arg, s) == 0)
+ return i;
+ i++;
+ while (*s++ != '\0')
+ continue;
+ }
+ return -1;
+}
+
static char *
unpack_scripts(void)
{
@@ -992,26 +1008,6 @@ unpack_scripts(void)
return outbuf;
}
-/*
- * In standalone shell mode we sometimes want the index of the script
- * and sometimes the index offset by NUM_APPLETS.
- */
-static int
-find_script_by_name(const char *arg)
-{
- const char *s = script_names;
- int i = 0;
-
- while (*s) {
- if (strcmp(arg, s) == 0)
- return i;
- i++;
- while (*s++ != '\0')
- continue;
- }
- return -1;
-}
-
char* FAST_FUNC
get_script_content(unsigned n)
{