From e308dfd9647221dc2fcb2186edde86ac30ed2c6c Mon Sep 17 00:00:00 2001 From: stefanf Date: Thu, 8 Dec 2005 20:08:36 +0000 Subject: Correctly quote the output when showing the installed trap actions. PR: 74043 Submitted by: Jilles Tjoelker --- bin/sh/trap.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'bin/sh') 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); } } } -- cgit v1.1