summaryrefslogtreecommitdiffstats
path: root/bin/sh
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2005-12-08 20:08:36 +0000
committerstefanf <stefanf@FreeBSD.org>2005-12-08 20:08:36 +0000
commite308dfd9647221dc2fcb2186edde86ac30ed2c6c (patch)
tree82e5aa0610e29e1de7dcb6ec843bc2e8a311c974 /bin/sh
parent82f361258c95855bb9a218b0a0c30ab1f68390bb (diff)
downloadFreeBSD-src-e308dfd9647221dc2fcb2186edde86ac30ed2c6c.zip
FreeBSD-src-e308dfd9647221dc2fcb2186edde86ac30ed2c6c.tar.gz
Correctly quote the output when showing the installed trap actions.
PR: 74043 Submitted by: Jilles Tjoelker
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/trap.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/bin/sh/trap.c b/bin/sh/trap.c
index 5f12379..71a14ba 100644
--- a/bin/sh/trap.c
+++ b/bin/sh/trap.c
@@ -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);
}
}
}
OpenPOWER on IntegriCloud