From e74aaf93854b9453b9949954aec77710b257d8b6 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 27 Sep 2009 02:05:45 +0200 Subject: 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 --- shell/hush.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'shell/hush.c') 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) if (G.traps[i]) { printf("trap -- "); print_escaped(G.traps[i]); - /* bash compat: it says SIGxxx, not just xxx */ - printf(" %s%s\n", i == 0 ? "" : "SIG", get_signame(i)); + /* note: bash adds "SIG", but only if invoked + * as "bash". If called as "sh", or if set -o posix, + * then it prints short signal names. + * We are printing short names: */ + printf(" %s\n", get_signame(i)); } } /*fflush(stdout); - done after each builtin anyway */ -- cgit v1.2.3