hush: cosmetics. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
e8405619fa
commit
c0836530f1
21
shell/hush.c
21
shell/hush.c
@ -4184,7 +4184,7 @@ static void debug_print_tree(struct pipe *pi, int lvl)
|
|||||||
pin++;
|
pin++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* debug_print_tree */
|
||||||
|
|
||||||
/* NB: called by pseudo_exec, and therefore must not modify any
|
/* NB: called by pseudo_exec, and therefore must not modify any
|
||||||
* global data until exec/_exit (we can be a child after vfork!) */
|
* global data until exec/_exit (we can be a child after vfork!) */
|
||||||
@ -4793,7 +4793,7 @@ static int reserved_word(o_string *word, struct parse_context *ctx)
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* HAS_KEYWORDS */
|
||||||
|
|
||||||
/* Word is complete, look at it and update parsing context.
|
/* Word is complete, look at it and update parsing context.
|
||||||
* Normal return is 0. Syntax errors return 1.
|
* Normal return is 0. Syntax errors return 1.
|
||||||
@ -5336,7 +5336,7 @@ static int process_command_subs(o_string *dest, const char *s)
|
|||||||
debug_printf("closed FILE from child. return 0\n");
|
debug_printf("closed FILE from child. return 0\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* ENABLE_HUSH_TICK */
|
||||||
|
|
||||||
static int parse_group(o_string *dest, struct parse_context *ctx,
|
static int parse_group(o_string *dest, struct parse_context *ctx,
|
||||||
struct in_str *input, int ch)
|
struct in_str *input, int ch)
|
||||||
@ -5704,7 +5704,7 @@ static int handle_dollar(o_string *as_string,
|
|||||||
o_addchr(dest, SPECIAL_VAR_SYMBOL);
|
o_addchr(dest, SPECIAL_VAR_SYMBOL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#if (ENABLE_SH_MATH_SUPPORT || ENABLE_HUSH_TICK)
|
#if ENABLE_SH_MATH_SUPPORT || ENABLE_HUSH_TICK
|
||||||
case '(': {
|
case '(': {
|
||||||
# if !BB_MMU
|
# if !BB_MMU
|
||||||
int pos;
|
int pos;
|
||||||
@ -6169,8 +6169,9 @@ static struct pipe *parse_stream(char **pstring,
|
|||||||
/* Example: echo Hello \2>file
|
/* Example: echo Hello \2>file
|
||||||
* we need to know that word 2 is quoted */
|
* we need to know that word 2 is quoted */
|
||||||
dest.o_quoted = 1;
|
dest.o_quoted = 1;
|
||||||
} else {
|
}
|
||||||
#if !BB_MMU
|
#if !BB_MMU
|
||||||
|
else {
|
||||||
/* It's "\<newline>". Remove trailing '\' from ctx.as_string */
|
/* It's "\<newline>". Remove trailing '\' from ctx.as_string */
|
||||||
ctx.as_string.data[--ctx.as_string.length] = '\0';
|
ctx.as_string.data[--ctx.as_string.length] = '\0';
|
||||||
#endif
|
#endif
|
||||||
@ -6914,30 +6915,30 @@ static int FAST_FUNC builtin_true(char **argv UNUSED_PARAM)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int FAST_FUNC _builtin_applet(char **argv, int (applet)(int argc, char **argv))
|
static int FAST_FUNC run_applet_main(char **argv, int (*applet_main)(int argc, char **argv))
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
while (*argv) {
|
while (*argv) {
|
||||||
argc++;
|
argc++;
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
return applet(argc, argv - argc);
|
return applet_main(argc, argv - argc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int FAST_FUNC builtin_test(char **argv)
|
static int FAST_FUNC builtin_test(char **argv)
|
||||||
{
|
{
|
||||||
return _builtin_applet(argv, test_main);
|
return run_applet_main(argv, test_main);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int FAST_FUNC builtin_echo(char **argv)
|
static int FAST_FUNC builtin_echo(char **argv)
|
||||||
{
|
{
|
||||||
return _builtin_applet(argv, echo_main);
|
return run_applet_main(argv, echo_main);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_PRINTF
|
#if ENABLE_PRINTF
|
||||||
static int FAST_FUNC builtin_printf(char **argv)
|
static int FAST_FUNC builtin_printf(char **argv)
|
||||||
{
|
{
|
||||||
return _builtin_applet(argv, printf_main);
|
return run_applet_main(argv, printf_main);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user