summaryrefslogtreecommitdiff
path: root/coreutils/printf.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-12-31 03:33:50 +0000
committerDenis Vlasenko2008-12-31 03:33:50 +0000
commit15c0b725849875c718b168a26e13872e163cde4c (patch)
tree687a5425953ae362ef285c6c671f09a05d3fa3c0 /coreutils/printf.c
parentccdc13d306c0a8d2735488bf8e46503f7e567767 (diff)
downloadbusybox-15c0b725849875c718b168a26e13872e163cde4c.zip
busybox-15c0b725849875c718b168a26e13872e163cde4c.tar.gz
Apply post 1.13.1 patches, bump to 1.13.21_13_2
Diffstat (limited to 'coreutils/printf.c')
-rw-r--r--coreutils/printf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/coreutils/printf.c b/coreutils/printf.c
index 76524f7..b0a48cd 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -359,8 +359,15 @@ int printf_main(int argc UNUSED_PARAM, char **argv)
* We will mimic coreutils. */
if (argv[1] && argv[1][0] == '-' && argv[1][1] == '-' && !argv[1][2])
argv++;
- if (!argv[1])
+ if (!argv[1]) {
+ if (ENABLE_ASH_BUILTIN_PRINTF
+ && applet_name[0] != 'p'
+ ) {
+ bb_error_msg("usage: printf FORMAT [ARGUMENT...]");
+ return 2; /* bash compat */
+ }
bb_show_usage();
+ }
format = argv[1];
argv2 = argv + 2;