1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-19 11:31:26 +01:00

36008: trap: Fix listing of traps created under non-alias non-canonical signal spelling

This commit is contained in:
Daniel Shahaf 2015-08-08 21:43:43 +00:00
parent 1e0ba96c7d
commit 1122d83a6e
2 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2015-08-08 Daniel Shahaf <d.s@daniel.shahaf.name>
* 36008: Src/builtin.c: trap: Fix listing of traps created
under non-alias non-canonical signal spelling
2015-08-08 Mikael Magnusson <mikachu@gmail.com>
* 35954: Doc/Zsh/mod_system.yo: sysopen -u is not optional

View file

@ -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.