aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-10-15 03:32:39 -0400
committerMike Frysinger <vapier@gentoo.org>2009-10-15 03:33:31 -0400
commit4ebc76c8a23367eaec29931b77e10e3ee890dd7d (patch)
tree5f157e8abd94e6c20277e85573f16146bc099178
parentccb1959aa519f45967e7600c6eb11f70211364df (diff)
downloadbusybox-w32-4ebc76c8a23367eaec29931b77e10e3ee890dd7d.tar.gz
busybox-w32-4ebc76c8a23367eaec29931b77e10e3ee890dd7d.tar.bz2
busybox-w32-4ebc76c8a23367eaec29931b77e10e3ee890dd7d.zip
hush: add a printf builtin
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--shell/hush.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 3a1d6f805..2d333d731 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -587,6 +587,9 @@ static int builtin_local(char **argv) FAST_FUNC;
587#if HUSH_DEBUG 587#if HUSH_DEBUG
588static int builtin_memleak(char **argv) FAST_FUNC; 588static int builtin_memleak(char **argv) FAST_FUNC;
589#endif 589#endif
590#if ENABLE_PRINTF
591static int builtin_printf(char **argv) FAST_FUNC;
592#endif
590static int builtin_pwd(char **argv) FAST_FUNC; 593static int builtin_pwd(char **argv) FAST_FUNC;
591static int builtin_read(char **argv) FAST_FUNC; 594static int builtin_read(char **argv) FAST_FUNC;
592static int builtin_set(char **argv) FAST_FUNC; 595static int builtin_set(char **argv) FAST_FUNC;
@@ -674,6 +677,9 @@ static const struct built_in_command bltins1[] = {
674static const struct built_in_command bltins2[] = { 677static const struct built_in_command bltins2[] = {
675 BLTIN("[" , builtin_test , NULL), 678 BLTIN("[" , builtin_test , NULL),
676 BLTIN("echo" , builtin_echo , NULL), 679 BLTIN("echo" , builtin_echo , NULL),
680#if ENABLE_PRINTF
681 BLTIN("printf" , builtin_printf , NULL),
682#endif
677 BLTIN("pwd" , builtin_pwd , NULL), 683 BLTIN("pwd" , builtin_pwd , NULL),
678 BLTIN("test" , builtin_test , NULL), 684 BLTIN("test" , builtin_test , NULL),
679}; 685};
@@ -6917,6 +6923,13 @@ static int FAST_FUNC builtin_echo(char **argv)
6917 return _builtin_applet(argv, echo_main); 6923 return _builtin_applet(argv, echo_main);
6918} 6924}
6919 6925
6926#if ENABLE_PRINTF
6927static int FAST_FUNC builtin_printf(char **argv)
6928{
6929 return _builtin_applet(argv, printf_main);
6930}
6931#endif
6932
6920static int FAST_FUNC builtin_eval(char **argv) 6933static int FAST_FUNC builtin_eval(char **argv)
6921{ 6934{
6922 int rcode = EXIT_SUCCESS; 6935 int rcode = EXIT_SUCCESS;