All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [BUILTIN] Allow SIG* signal names.
@ 2012-07-01 10:12 Isaac Jurado
  2012-07-02 13:51 ` Eric Blake
  0 siblings, 1 reply; 11+ messages in thread
From: Isaac Jurado @ 2012-07-01 10:12 UTC (permalink / raw)


In other shells, both trap and kill builtins accept two form of signal names,
i.e., TERM and SIGTERM.  Even /bin/kill allows the SIG* form.  Having dash fail
by not recognizing the SIG prefix introduces some confusion among users.
---
 src/trap.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/trap.c b/src/trap.c
index 17316c9..a64133c 100644
--- a/src/trap.c
+++ b/src/trap.c
@@ -408,6 +408,9 @@ int decode_signal(const char *string, int minsig)
 		return signo;
 	}
 
+	if (string[0] == 'S' && string[1] == 'I' && string[2] == 'G')
+		string += 3;
+
 	for (signo = minsig; signo < NSIG; signo++) {
 		if (!strcasecmp(string, signal_names[signo])) {
 			return signo;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-07-05 21:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-01 10:12 [PATCH] [BUILTIN] Allow SIG* signal names Isaac Jurado
2012-07-02 13:51 ` Eric Blake
2012-07-02 14:11   ` Paul Gilmartin
2012-07-02 14:22     ` Eric Blake
2012-07-02 18:53       ` Isaac Jurado
2012-07-02 18:57         ` Isaac Jurado
2012-07-02 19:07         ` Eric Blake
2012-07-02 19:21           ` Isaac Jurado
2012-07-03 20:13       ` Jilles Tjoelker
2012-07-05  7:43         ` Herbert Xu
2012-07-05 21:01           ` Isaac Jurado

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.