kumquat-buildroot/package/busybox/busybox-1.13.1-printf.patch
2008-12-10 13:46:19 +00:00

20 lines
532 B
Diff

--- busybox-1.13.1/coreutils/printf.c Sun Nov 9 18:28:07 2008
+++ busybox-1.13.1-printf/coreutils/printf.c Wed Dec 10 12:50:55 2008
@@ -359,8 +359,15 @@
* 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;