[PATCH] [BUILTIN] Allow SIG* signal names.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux