diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-29 19:48:30 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-29 19:48:30 +0000 |
commit | 4f504a9e575f6acda8a1402b88b2fdb63b11d8f7 (patch) | |
tree | eb662e5e862762b2b7269596d9c3552ef1fab75d | |
parent | 87a8655f4600cdad2b9af3312084a83e619c9abd (diff) | |
download | busybox-w32-4f504a9e575f6acda8a1402b88b2fdb63b11d8f7.tar.gz busybox-w32-4f504a9e575f6acda8a1402b88b2fdb63b11d8f7.tar.bz2 busybox-w32-4f504a9e575f6acda8a1402b88b2fdb63b11d8f7.zip |
hush: trivial code shrink
function old new delta
builtin_continue 48 22 -26
-rw-r--r-- | shell/hush.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/shell/hush.c b/shell/hush.c index b471bd845..eab007943 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -4526,7 +4526,7 @@ static int builtin_unset(char **argv) | |||
4526 | static int builtin_break(char **argv) | 4526 | static int builtin_break(char **argv) |
4527 | { | 4527 | { |
4528 | if (G.depth_of_loop == 0) { | 4528 | if (G.depth_of_loop == 0) { |
4529 | bb_error_msg("%s: only meaningful in a loop", "break"); | 4529 | bb_error_msg("%s: only meaningful in a loop", argv[0]); |
4530 | return EXIT_SUCCESS; /* bash compat */ | 4530 | return EXIT_SUCCESS; /* bash compat */ |
4531 | } | 4531 | } |
4532 | G.flag_break_continue++; /* BC_BREAK = 1 */ | 4532 | G.flag_break_continue++; /* BC_BREAK = 1 */ |
@@ -4534,7 +4534,7 @@ static int builtin_break(char **argv) | |||
4534 | if (argv[1]) { | 4534 | if (argv[1]) { |
4535 | G.depth_break_continue = bb_strtou(argv[1], NULL, 10); | 4535 | G.depth_break_continue = bb_strtou(argv[1], NULL, 10); |
4536 | if (errno || !G.depth_break_continue || argv[2]) { | 4536 | if (errno || !G.depth_break_continue || argv[2]) { |
4537 | bb_error_msg("bad arguments"); | 4537 | bb_error_msg("%s: bad arguments", argv[0]); |
4538 | G.flag_break_continue = BC_BREAK; | 4538 | G.flag_break_continue = BC_BREAK; |
4539 | G.depth_break_continue = UINT_MAX; | 4539 | G.depth_break_continue = UINT_MAX; |
4540 | } | 4540 | } |
@@ -4546,11 +4546,7 @@ static int builtin_break(char **argv) | |||
4546 | 4546 | ||
4547 | static int builtin_continue(char **argv) | 4547 | static int builtin_continue(char **argv) |
4548 | { | 4548 | { |
4549 | if (G.depth_of_loop) { | 4549 | G.flag_break_continue = 1; /* BC_CONTINUE = 2 = 1+1 */ |
4550 | G.flag_break_continue = 1; /* BC_CONTINUE = 2 = 1+1 */ | 4550 | return builtin_break(argv); |
4551 | return builtin_break(argv); | ||
4552 | } | ||
4553 | bb_error_msg("%s: only meaningful in a loop", "continue"); | ||
4554 | return EXIT_SUCCESS; /* bash compat */ | ||
4555 | } | 4551 | } |
4556 | #endif | 4552 | #endif |