summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/signal.c b/signal.c
index 8d75c3bc5c..317537cae5 100644
--- a/signal.c
+++ b/signal.c
@@ -753,6 +753,10 @@ trap_handler(VALUE *cmd, int sig)
}
else {
command = rb_check_string_type(*cmd);
+ if (NIL_P(command) && SYMBOL_P(*cmd)) {
+ command = rb_id2str(SYM2ID(*cmd));
+ if (!command) rb_raise(rb_eArgError, "bad handler");
+ }
if (!NIL_P(command)) {
SafeStringValue(command); /* taint check */
*cmd = command;