diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-27 02:05:45 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-27 02:05:45 +0200 |
commit | e74aaf93854b9453b9949954aec77710b257d8b6 (patch) | |
tree | 0be4c4457b9567427706871bfb62fafa296eca19 /shell/hush.c | |
parent | 6c750f15180ba51ef37c6cfa381b52e6b05d55aa (diff) | |
download | busybox-w32-e74aaf93854b9453b9949954aec77710b257d8b6.tar.gz busybox-w32-e74aaf93854b9453b9949954aec77710b257d8b6.tar.bz2 busybox-w32-e74aaf93854b9453b9949954aec77710b257d8b6.zip |
ash,hush: make trap output short signal names, without SIG prefix
function old new delta
evalvar 1373 1371 -2
builtin_trap 457 441 -16
trapcmd 260 236 -24
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c index d75b0da7e..b515eabd2 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -7111,8 +7111,11 @@ static int FAST_FUNC builtin_trap(char **argv) | |||
7111 | if (G.traps[i]) { | 7111 | if (G.traps[i]) { |
7112 | printf("trap -- "); | 7112 | printf("trap -- "); |
7113 | print_escaped(G.traps[i]); | 7113 | print_escaped(G.traps[i]); |
7114 | /* bash compat: it says SIGxxx, not just xxx */ | 7114 | /* note: bash adds "SIG", but only if invoked |
7115 | printf(" %s%s\n", i == 0 ? "" : "SIG", get_signame(i)); | 7115 | * as "bash". If called as "sh", or if set -o posix, |
7116 | * then it prints short signal names. | ||
7117 | * We are printing short names: */ | ||
7118 | printf(" %s\n", get_signame(i)); | ||
7116 | } | 7119 | } |
7117 | } | 7120 | } |
7118 | /*fflush(stdout); - done after each builtin anyway */ | 7121 | /*fflush(stdout); - done after each builtin anyway */ |