Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
if (!*ap) {
for (signo = 0; signo < NSIG; signo++) {
if (trap[signo] != NULL) {
- out1fmt("trap -- %s SIG%s\n",
+ out1fmt("trap -- %s %s%s\n",
single_quote(trap[signo]),
+ (signo == 0 ? "" : "SIG"),
get_signame(signo));
}
}
printf("trap -- ");
print_escaped(G.traps[i]);
/* bash compat: it says SIGxxx, not just xxx */
- printf(" SIG%s\n", get_signame(i));
+ printf(" %s%s\n", i == 0 ? "" : "SIG", get_signame(i));
}
}
/*fflush(stdout); - done after each builtin anyway */
___
___
trap -- 'a' EXIT
-trap -- 'a' INT
-trap -- 'a' USR1
-trap -- 'a' USR2
+trap -- 'a' SIGINT
+trap -- 'a' SIGUSR1
+trap -- 'a' SIGUSR2
___
___
-trap -- 'a' USR1
-trap -- 'a' USR2
+trap -- 'a' SIGUSR1
+trap -- 'a' SIGUSR2
___
___
-trap -- 'a' USR2
+trap -- 'a' SIGUSR2