summaryrefslogtreecommitdiffstats
path: root/package/busybox/busybox-1.13.1-printf.patch
blob: 43f4135b688ccc95c5c3bbd6b7b38aeb50da9bd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- 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;