Correctly quote the output when showing the installed trap actions.

PR:		74043
Submitted by:	Jilles Tjoelker
This commit is contained in:
Stefan Farfeleder 2005-12-08 20:08:36 +00:00
parent 16f99fe169
commit 2a5e306d46

View File

@ -153,15 +153,14 @@ trapcmd(int argc, char **argv)
if (argc <= 1) {
for (signo = 0 ; signo < sys_nsig ; signo++) {
if (signo < NSIG && trap[signo] != NULL) {
out1str("trap -- ");
out1qstr(trap[signo]);
if (signo == 0) {
out1fmt("trap -- '%s' %s\n",
trap[signo], "exit");
out1str(" exit\n");
} else if (sys_signame[signo]) {
out1fmt("trap -- '%s' %s\n",
trap[signo], sys_signame[signo]);
out1fmt(" %s\n", sys_signame[signo]);
} else {
out1fmt("trap -- '%s' %d\n",
trap[signo], signo);
out1fmt(" %d\n", signo);
}
}
}