about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2015-08-08 21:43:43 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2015-08-08 21:43:49 +0000
commit1122d83a6e508ddec5c6a9a04918a3646c667463 (patch)
tree298ee7f865919e7ce6daf16ee0ae4fc7365a2206 /Src
parent1e0ba96c7d5a5bbdde3419bd802df788ad6b7e58 (diff)
downloadzsh-1122d83a6e508ddec5c6a9a04918a3646c667463.tar.gz
zsh-1122d83a6e508ddec5c6a9a04918a3646c667463.tar.xz
zsh-1122d83a6e508ddec5c6a9a04918a3646c667463.zip
36008: trap: Fix listing of traps created under non-alias non-canonical signal spelling
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index a08a7d468..34bad035d 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -6565,8 +6565,14 @@ bin_trap(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
 	    zwarnnam(name, "undefined signal: %s", *argv);
 	    break;
 	}
-	if (!strcmp(sigs[sig], *argv))
+	if (idigit(**argv) ||
+	    !strcmp(sigs[sig], *argv) ||
+	    (!strncmp("SIG", *argv, 3) && !strcmp(sigs[sig], *argv+3))) {
+	    /* The signal was specified by number or by canonical name (with
+	     * or without SIG prefix).
+	     */
 	    flags = 0;
+	}
 	else {
 	    /*
 	     * Record that the signal is used under an assumed name.