summaryrefslogtreecommitdiff
path: root/bin/ksh/trap.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-01-08 20:25:06 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-01-08 20:25:06 +0000
commit6a5d0cf1c0a39abcf664e579d4844baf976be409 (patch)
tree62ba360b692423222dd434b61fddf954a08a17bf /bin/ksh/trap.c
parent289d0caa4f5c6d3215a1ea49d80b71667099fd78 (diff)
bug fixes from pdksh-unstable-5.2.13.5; some of which we already had.
Diffstat (limited to 'bin/ksh/trap.c')
-rw-r--r--bin/ksh/trap.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/bin/ksh/trap.c b/bin/ksh/trap.c
index c2118b541e7..df6d9b63dd8 100644
--- a/bin/ksh/trap.c
+++ b/bin/ksh/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.8 1998/12/21 05:53:27 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.9 1999/01/08 20:25:02 millert Exp $ */
/*
* signal handling
@@ -84,8 +84,9 @@ alarm_catcher(sig)
#endif /* KSH */
Trap *
-gettrap(name)
+gettrap(name, igncase)
const char *name;
+ int igncase;
{
int i;
register Trap *p;
@@ -98,10 +99,20 @@ gettrap(name)
return NULL;
}
for (p = sigtraps, i = SIGNALS+1; --i >= 0; p++)
- if (p->name && (strcasecmp(p->name, name) == 0 ||
- (strlen(name) > 3 && !strncasecmp("SIG", p->name, 3) &&
- !strcasecmp(p->name, name + 3))))
- return p;
+ if (p->name) {
+ if (igncase) {
+ if (p->name && (!strcasecmp(p->name, name) ||
+ (strlen(name) > 3 && !strncasecmp("SIG",
+ p->name, 3) &&
+ !strcasecmp(p->name, name + 3))))
+ return p;
+ } else {
+ if (p->name && (!strcmp(p->name, name) ||
+ (strlen(name) > 3 && !strncmp("SIG",
+ p->name, 3) && !strcmp(p->name, name + 3))))
+ return p;
+ }
+ }
return NULL;
}