summaryrefslogtreecommitdiff
path: root/libbb/appletlib.c
diff options
context:
space:
mode:
authorRon Yorston2018-11-01 11:04:47 +0100
committerDenys Vlasenko2018-11-01 11:07:26 +0100
commit151de441e7a19ce3afba0c59b083240a801222cf (patch)
treeab4574bf623c162848b20d6495d139df23e337fd /libbb/appletlib.c
parentaa2959c90d9c3217ddb6f482b82fef7234ad9bde (diff)
downloadbusybox-151de441e7a19ce3afba0c59b083240a801222cf.zip
busybox-151de441e7a19ce3afba0c59b083240a801222cf.tar.gz
ash: recognize embedded scripts in SH_STANDALONE mode
function old new delta find_script_by_name - 51 +51 shellexec 254 271 +17 find_command 990 1007 +17 evalcommand 1653 1661 +8 doCommands 2233 2222 -11 run_applet_and_exit 128 100 -28 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 6/4 up/down: 104/-52) Total: 52 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r--libbb/appletlib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 4e6d1c3..92d99fb 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -964,20 +964,20 @@ 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)
+int FAST_FUNC
+find_script_by_name(const char *name)
{
const char *s = script_names;
int i = 0;
while (*s) {
- if (strcmp(arg, s) == 0)
+ if (strcmp(name, s) == 0)
return i;
i++;
while (*s++ != '\0')
continue;
}
- return -1;
+ return -0x10000; /* make it so that NUM_APPLETS + <error> is still < 0 */
}
static char *