diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-11-01 10:28:04 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-11-01 10:28:04 +0100 |
commit | aa2959c90d9c3217ddb6f482b82fef7234ad9bde (patch) | |
tree | 2acd656bf9936d20102817256ad6ed87d7084894 /libbb | |
parent | 4f2ef4a836be37b25808c94f41c7c85895db6f93 (diff) | |
download | busybox-w32-aa2959c90d9c3217ddb6f482b82fef7234ad9bde.tar.gz busybox-w32-aa2959c90d9c3217ddb6f482b82fef7234ad9bde.tar.bz2 busybox-w32-aa2959c90d9c3217ddb6f482b82fef7234ad9bde.zip |
claenups for previous commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/appletlib.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 08720082e..4e6d1c3d6 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 | |||
964 | # endif /* NUM_APPLETS > 0 */ | 964 | # endif /* NUM_APPLETS > 0 */ |
965 | 965 | ||
966 | # if NUM_SCRIPTS > 0 | 966 | # if NUM_SCRIPTS > 0 |
967 | static int | ||
968 | find_script_by_name(const char *arg) | ||
969 | { | ||
970 | const char *s = script_names; | ||
971 | int i = 0; | ||
972 | |||
973 | while (*s) { | ||
974 | if (strcmp(arg, s) == 0) | ||
975 | return i; | ||
976 | i++; | ||
977 | while (*s++ != '\0') | ||
978 | continue; | ||
979 | } | ||
980 | return -1; | ||
981 | } | ||
982 | |||
967 | static char * | 983 | static char * |
968 | unpack_scripts(void) | 984 | unpack_scripts(void) |
969 | { | 985 | { |
@@ -992,26 +1008,6 @@ unpack_scripts(void) | |||
992 | return outbuf; | 1008 | return outbuf; |
993 | } | 1009 | } |
994 | 1010 | ||
995 | /* | ||
996 | * In standalone shell mode we sometimes want the index of the script | ||
997 | * and sometimes the index offset by NUM_APPLETS. | ||
998 | */ | ||
999 | static int | ||
1000 | find_script_by_name(const char *arg) | ||
1001 | { | ||
1002 | const char *s = script_names; | ||
1003 | int i = 0; | ||
1004 | |||
1005 | while (*s) { | ||
1006 | if (strcmp(arg, s) == 0) | ||
1007 | return i; | ||
1008 | i++; | ||
1009 | while (*s++ != '\0') | ||
1010 | continue; | ||
1011 | } | ||
1012 | return -1; | ||
1013 | } | ||
1014 | |||
1015 | char* FAST_FUNC | 1011 | char* FAST_FUNC |
1016 | get_script_content(unsigned n) | 1012 | get_script_content(unsigned n) |
1017 | { | 1013 | { |