hush: add a printf builtin
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
ccb1959aa5
commit
4ebc76c8a2
13
shell/hush.c
13
shell/hush.c
@ -587,6 +587,9 @@ static int builtin_local(char **argv) FAST_FUNC;
|
|||||||
#if HUSH_DEBUG
|
#if HUSH_DEBUG
|
||||||
static int builtin_memleak(char **argv) FAST_FUNC;
|
static int builtin_memleak(char **argv) FAST_FUNC;
|
||||||
#endif
|
#endif
|
||||||
|
#if ENABLE_PRINTF
|
||||||
|
static int builtin_printf(char **argv) FAST_FUNC;
|
||||||
|
#endif
|
||||||
static int builtin_pwd(char **argv) FAST_FUNC;
|
static int builtin_pwd(char **argv) FAST_FUNC;
|
||||||
static int builtin_read(char **argv) FAST_FUNC;
|
static int builtin_read(char **argv) FAST_FUNC;
|
||||||
static int builtin_set(char **argv) FAST_FUNC;
|
static int builtin_set(char **argv) FAST_FUNC;
|
||||||
@ -674,6 +677,9 @@ static const struct built_in_command bltins1[] = {
|
|||||||
static const struct built_in_command bltins2[] = {
|
static const struct built_in_command bltins2[] = {
|
||||||
BLTIN("[" , builtin_test , NULL),
|
BLTIN("[" , builtin_test , NULL),
|
||||||
BLTIN("echo" , builtin_echo , NULL),
|
BLTIN("echo" , builtin_echo , NULL),
|
||||||
|
#if ENABLE_PRINTF
|
||||||
|
BLTIN("printf" , builtin_printf , NULL),
|
||||||
|
#endif
|
||||||
BLTIN("pwd" , builtin_pwd , NULL),
|
BLTIN("pwd" , builtin_pwd , NULL),
|
||||||
BLTIN("test" , builtin_test , NULL),
|
BLTIN("test" , builtin_test , NULL),
|
||||||
};
|
};
|
||||||
@ -6917,6 +6923,13 @@ static int FAST_FUNC builtin_echo(char **argv)
|
|||||||
return _builtin_applet(argv, echo_main);
|
return _builtin_applet(argv, echo_main);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENABLE_PRINTF
|
||||||
|
static int FAST_FUNC builtin_printf(char **argv)
|
||||||
|
{
|
||||||
|
return _builtin_applet(argv, printf_main);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int FAST_FUNC builtin_eval(char **argv)
|
static int FAST_FUNC builtin_eval(char **argv)
|
||||||
{
|
{
|
||||||
int rcode = EXIT_SUCCESS;
|
int rcode = EXIT_SUCCESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user