projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6a2d0d9
)
ash: printf builtin with no arguments should not exit
author
Denis Vlasenko
<vda.linux@googlemail.com>
Wed, 10 Dec 2008 11:51:45 +0000
(11:51 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Wed, 10 Dec 2008 11:51:45 +0000
(11:51 -0000)
coreutils/printf.c
patch
|
blob
|
history
diff --git
a/coreutils/printf.c
b/coreutils/printf.c
index 76524f70648e6d1d66ffa47c81d5f97facb8e4a9..b0a48cda4a1738b0baf95456a4e566efd245e579 100644
(file)
--- 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;