fix incorrect operation caused by the previous checkin.

This commit is contained in:
cgd 1999-05-09 00:00:20 +00:00
parent 0abc804e19
commit 75f8cf07ab
1 changed files with 9 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: proc.c,v 1.18 1999/05/08 23:12:29 christos Exp $ */
/* $NetBSD: proc.c,v 1.19 1999/05/09 00:00:20 cgd Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)proc.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: proc.c,v 1.18 1999/05/08 23:12:29 christos Exp $");
__RCSID("$NetBSD: proc.c,v 1.19 1999/05/09 00:00:20 cgd Exp $");
#endif
#endif /* not lint */
@ -973,6 +973,7 @@ dokill(v, t)
struct command *t;
{
int signum = SIGTERM;
Char *signame;
char *name;
v++;
@ -1006,14 +1007,14 @@ dokill(v, t)
}
else {
if (v[0][1] == 's' && (Isspace(v[0][2]) || v[0][2] == '\0'))
name = short2str(&v[0][0]);
signame = *(++v);
else
name = short2str(&v[0][1]);
v++;
signame = &v[0][1];
if (v[0] == NULL || v[1] == NULL)
if (signame == NULL || v[1] == NULL)
stderror(ERR_NAME | ERR_TOOFEW);
name = short2str(signame);
for (signum = 1; signum < NSIG; signum++)
if (!strcasecmp(sys_signame[signum], name) ||
(!strncasecmp("SIG", name, 3) && /* skip "SIG" prefix */
@ -1021,10 +1022,10 @@ dokill(v, t)
break;
if (signum == NSIG) {
if (v[0][0] == '0')
if (signame[0] == '0')
signum = 0;
else {
setname(vis_str(&v[0][0]));
setname(vis_str(signame));
stderror(ERR_NAME | ERR_UNKSIG);
}
}