diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/Config.in | 7 | ||||
-rw-r--r-- | shell/ash.c | 14 |
2 files changed, 16 insertions, 5 deletions
diff --git a/shell/Config.in b/shell/Config.in index 94ffa09..a670162 100644 --- a/shell/Config.in +++ b/shell/Config.in @@ -114,6 +114,13 @@ config ASH_BUILTIN_ECHO help Enable support for echo, builtin to ash. +config ASH_BUILTIN_PRINTF + bool "Builtin version of 'printf'" + default y + depends on ASH + help + Enable support for printf, builtin to ash. + config ASH_BUILTIN_TEST bool "Builtin version of 'test'" default y diff --git a/shell/ash.c b/shell/ash.c index 20b93f3..31beb86 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -8488,17 +8488,18 @@ static int ulimitcmd(int, char **); * Apart from the above, [[ expr ]] should work as [ expr ] */ -#define testcmd test_main -#define echocmd echo_main +#define echocmd echo_main +#define printfcmd printf_main +#define testcmd test_main /* Keep these in proper order since it is searched via bsearch() */ static const struct builtincmd builtintab[] = { { BUILTIN_SPEC_REG ".", dotcmd }, { BUILTIN_SPEC_REG ":", truecmd }, #if ENABLE_ASH_BUILTIN_TEST - { BUILTIN_REGULAR "[", testcmd }, + { BUILTIN_REGULAR "[", testcmd }, #if ENABLE_ASH_BASH_COMPAT - { BUILTIN_REGULAR "[[", testcmd }, + { BUILTIN_REGULAR "[[", testcmd }, #endif #endif #if ENABLE_ASH_ALIAS @@ -8540,6 +8541,9 @@ static const struct builtincmd builtintab[] = { { BUILTIN_NOSPEC "let", letcmd }, #endif { BUILTIN_ASSIGN "local", localcmd }, +#if ENABLE_ASH_BUILTIN_PRINTF + { BUILTIN_REGULAR "printf", printfcmd }, +#endif { BUILTIN_NOSPEC "pwd", pwdcmd }, { BUILTIN_REGULAR "read", readcmd }, { BUILTIN_SPEC_REG_ASSG "readonly", exportcmd }, @@ -8548,7 +8552,7 @@ static const struct builtincmd builtintab[] = { { BUILTIN_SPEC_REG "shift", shiftcmd }, { BUILTIN_SPEC_REG "source", dotcmd }, #if ENABLE_ASH_BUILTIN_TEST - { BUILTIN_REGULAR "test", testcmd }, + { BUILTIN_REGULAR "test", testcmd }, #endif { BUILTIN_SPEC_REG "times", timescmd }, { BUILTIN_SPEC_REG "trap", trapcmd }, |