svn commit: trunk/busybox/shell

vda at busybox.net vda at busybox.net
Tue Jul 29 19:48:30 UTC 2008


Author: vda
Date: 2008-07-29 12:48:30 -0700 (Tue, 29 Jul 2008)
New Revision: 22989

Log:
hush: trivial code shrink

function                                             old     new   delta
builtin_continue                                      48      22     -26



Modified:
   trunk/busybox/shell/hush.c


Changeset:
Modified: trunk/busybox/shell/hush.c
===================================================================
--- trunk/busybox/shell/hush.c	2008-07-29 19:43:10 UTC (rev 22988)
+++ trunk/busybox/shell/hush.c	2008-07-29 19:48:30 UTC (rev 22989)
@@ -4526,7 +4526,7 @@
 static int builtin_break(char **argv)
 {
 	if (G.depth_of_loop == 0) {
-		bb_error_msg("%s: only meaningful in a loop", "break");
+		bb_error_msg("%s: only meaningful in a loop", argv[0]);
 		return EXIT_SUCCESS; /* bash compat */
 	}
 	G.flag_break_continue++; /* BC_BREAK = 1 */
@@ -4534,7 +4534,7 @@
 	if (argv[1]) {
 		G.depth_break_continue = bb_strtou(argv[1], NULL, 10);
 		if (errno || !G.depth_break_continue || argv[2]) {
-			bb_error_msg("bad arguments");
+			bb_error_msg("%s: bad arguments", argv[0]);
 			G.flag_break_continue = BC_BREAK;
 			G.depth_break_continue = UINT_MAX;
 		}
@@ -4546,11 +4546,7 @@
 
 static int builtin_continue(char **argv)
 {
-	if (G.depth_of_loop) {
-		G.flag_break_continue = 1; /* BC_CONTINUE = 2 = 1+1 */
-		return builtin_break(argv);
-	}
-	bb_error_msg("%s: only meaningful in a loop", "continue");
-	return EXIT_SUCCESS; /* bash compat */
+	G.flag_break_continue = 1; /* BC_CONTINUE = 2 = 1+1 */
+	return builtin_break(argv);
 }
 #endif




More information about the busybox-cvs mailing list