claenups for previous commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
4f2ef4a836
commit
aa2959c90d
@ -964,6 +964,22 @@ void FAST_FUNC run_applet_no_and_exit(int applet_no, const char *name, char **ar
|
|||||||
# endif /* NUM_APPLETS > 0 */
|
# endif /* NUM_APPLETS > 0 */
|
||||||
|
|
||||||
# if NUM_SCRIPTS > 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 *
|
static char *
|
||||||
unpack_scripts(void)
|
unpack_scripts(void)
|
||||||
{
|
{
|
||||||
@ -992,26 +1008,6 @@ unpack_scripts(void)
|
|||||||
return outbuf;
|
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
|
char* FAST_FUNC
|
||||||
get_script_content(unsigned n)
|
get_script_content(unsigned n)
|
||||||
{
|
{
|
||||||
|
11
shell/ash.c
11
shell/ash.c
@ -153,15 +153,10 @@
|
|||||||
//config: default y
|
//config: default y
|
||||||
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
|
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
|
||||||
//config: help
|
//config: help
|
||||||
//config: Allow scripts to be compressed and embedded in the BusyBox
|
//config: Allow scripts to be compressed and embedded in the busybox
|
||||||
//config: binary. The scripts should be placed in the 'embed' directory
|
//config: binary. The scripts should be placed in the 'embed' directory
|
||||||
//config: at build time. In standalone shell mode such scripts can be
|
//config: at build time. Like applets, scripts can be run as
|
||||||
//config: run directly and are subject to tab completion; otherwise they
|
//config: 'busybox SCRIPT ...' or by linking their name to the binary.
|
||||||
//config: can be run by giving their name as an argument to the shell.
|
|
||||||
//config: For convenience shell aliases are created. The '-L' shell
|
|
||||||
//config: argument lists the names of the scripts. Like applets scripts
|
|
||||||
//config: can be run as 'busybox name ...' or by linking their name to
|
|
||||||
//config: the binary.
|
|
||||||
//config:
|
//config:
|
||||||
//config:endif # ash options
|
//config:endif # ash options
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user