mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-02 22:11:54 +02:00
Danek: 30485: trailing garbage after signal number not recognised in kill
This commit is contained in:
parent
338c70ff56
commit
d64e62ef11
2 changed files with 14 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-05-22 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* Danek: 30485: Src/jobs.c: trailing garbage after signal
|
||||
number not recognised in kill builtin.
|
||||
|
||||
2012-05-21 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* c.f 30482 (Peter Jaros): Completion/Unix/Command/_tmux: typo
|
||||
|
@ -16313,5 +16318,5 @@
|
|||
|
||||
*****************************************************
|
||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||
* $Revision: 1.5656 $
|
||||
* $Revision: 1.5657 $
|
||||
*****************************************************
|
||||
|
|
11
Src/jobs.c
11
Src/jobs.c
|
@ -2164,10 +2164,15 @@ bin_kill(char *nam, char **argv, UNUSED(Options ops), UNUSED(int func))
|
|||
|
||||
/* check for, and interpret, a signal specifier */
|
||||
if (*argv && **argv == '-') {
|
||||
if (idigit((*argv)[1]))
|
||||
if (idigit((*argv)[1])) {
|
||||
char *endp;
|
||||
/* signal specified by number */
|
||||
sig = atoi(*argv + 1);
|
||||
else if ((*argv)[1] != '-' || (*argv)[2]) {
|
||||
sig = zstrtol(*argv + 1, &endp, 10);
|
||||
if (*endp) {
|
||||
zwarnnam(nam, "invalid signal number: %s", *argv);
|
||||
return 1;
|
||||
}
|
||||
} else if ((*argv)[1] != '-' || (*argv)[2]) {
|
||||
char *signame;
|
||||
|
||||
/* with argument "-l" display the list of signal names */
|
||||
|
|
Loading…
Reference in a new issue