summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2008-07-29 19:48:30 +0000
committerDenis Vlasenko2008-07-29 19:48:30 +0000
commit4f504a9e575f6acda8a1402b88b2fdb63b11d8f7 (patch)
treeeb662e5e862762b2b7269596d9c3552ef1fab75d
parent87a8655f4600cdad2b9af3312084a83e619c9abd (diff)
downloadbusybox-4f504a9e575f6acda8a1402b88b2fdb63b11d8f7.zip
busybox-4f504a9e575f6acda8a1402b88b2fdb63b11d8f7.tar.gz
hush: trivial code shrink
function old new delta builtin_continue 48 22 -26
-rw-r--r--shell/hush.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/shell/hush.c b/shell/hush.c
index b471bd8..eab0079 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -4526,7 +4526,7 @@ static int builtin_unset(char **argv)
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 @@ static int builtin_break(char **argv)
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_break(char **argv)
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