summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-21 05:53:28 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-21 05:53:28 +0000
commitcf85f7cf0e08f6b4a2013b40ca5c576efff262c4 (patch)
tree5e3c7ec92e0071cd238fcea655557f7d14cd0f93
parent660d8a068e8535dcbba8243f76cb4843586c96fe (diff)
correct built-in kill
-rw-r--r--bin/csh/proc.c6
-rw-r--r--bin/ksh/trap.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/bin/csh/proc.c b/bin/csh/proc.c
index 860da94c780..c1de6aa85bd 100644
--- a/bin/csh/proc.c
+++ b/bin/csh/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.10 1998/12/21 05:44:32 deraadt Exp $ */
+/* $OpenBSD: proc.c,v 1.11 1998/12/21 05:53:26 deraadt Exp $ */
/* $NetBSD: proc.c,v 1.9 1995/04/29 23:21:33 mycroft Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)proc.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: proc.c,v 1.10 1998/12/21 05:44:32 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: proc.c,v 1.11 1998/12/21 05:53:26 deraadt Exp $";
#endif
#endif /* not lint */
@@ -1022,7 +1022,7 @@ dokill(v, t)
for (signum = 1; signum < NSIG; signum++)
if (!strcasecmp(sys_signame[signum], name) ||
- (!strncasecmp("SIG", name, 3) && /* skip "SIG" prefix */
+ (strlen(name) > 3 && !strncasecmp("SIG", name, 3) &&
!strcasecmp(sys_signame[signum], name + 3)))
break;
diff --git a/bin/ksh/trap.c b/bin/ksh/trap.c
index 9b9076caf2b..c2118b541e7 100644
--- a/bin/ksh/trap.c
+++ b/bin/ksh/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.7 1998/10/29 04:09:21 millert Exp $ */
+/* $OpenBSD: trap.c,v 1.8 1998/12/21 05:53:27 deraadt Exp $ */
/*
* signal handling
@@ -98,7 +98,9 @@ gettrap(name)
return NULL;
}
for (p = sigtraps, i = SIGNALS+1; --i >= 0; p++)
- if (p->name && strcasecmp(p->name, name) == 0)
+ if (p->name && (strcasecmp(p->name, name) == 0 ||
+ (strlen(name) > 3 && !strncasecmp("SIG", p->name, 3) &&
+ !strcasecmp(p->name, name + 3))))
return p;
return NULL;
}