diff options
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index c909cae2b..d7355ce81 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -12267,13 +12267,16 @@ trapcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
12267 | for (signo = 0; signo < NSIG; signo++) { | 12267 | for (signo = 0; signo < NSIG; signo++) { |
12268 | char *tr = trap_ptr[signo]; | 12268 | char *tr = trap_ptr[signo]; |
12269 | if (tr) { | 12269 | if (tr) { |
12270 | out1fmt("trap -- %s %s%s\n", | 12270 | /* note: bash adds "SIG", but only if invoked |
12271 | * as "bash". If called as "sh", or if set -o posix, | ||
12272 | * then it prints short signal names. | ||
12273 | * We are printing short names: */ | ||
12274 | out1fmt("trap -- %s %s\n", | ||
12271 | single_quote(tr), | 12275 | single_quote(tr), |
12272 | (signo == 0 ? "" : "SIG"), | ||
12273 | get_signame(signo)); | 12276 | get_signame(signo)); |
12274 | /* trap_ptr != trap only if we are in special-cased `trap` code. | 12277 | /* trap_ptr != trap only if we are in special-cased `trap` code. |
12275 | * In this case, we will exit very soon, no need to free(). */ | 12278 | * In this case, we will exit very soon, no need to free(). */ |
12276 | /* if (trap_ptr != trap) */ | 12279 | /* if (trap_ptr != trap && tp[0]) */ |
12277 | /* free(tr); */ | 12280 | /* free(tr); */ |
12278 | } | 12281 | } |
12279 | } | 12282 | } |