summaryrefslogtreecommitdiff
path: root/usr.bin/pkill/pkill.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/pkill/pkill.c')
-rw-r--r--usr.bin/pkill/pkill.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c
index dc0611ff7b7..ac96a9ca5e2 100644
--- a/usr.bin/pkill/pkill.c
+++ b/usr.bin/pkill/pkill.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pkill.c,v 1.9 2005/03/02 21:45:53 otto Exp $ */
+/* $OpenBSD: pkill.c,v 1.10 2005/03/27 14:50:09 robert Exp $ */
/* $NetBSD: pkill.c,v 1.5 2002/10/27 11:49:34 kleink Exp $ */
/*-
@@ -38,7 +38,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: pkill.c,v 1.9 2005/03/02 21:45:53 otto Exp $";
+static const char rcsid[] = "$OpenBSD: pkill.c,v 1.10 2005/03/27 14:50:09 robert Exp $";
#endif /* !lint */
#include <sys/types.h>
@@ -94,6 +94,7 @@ int inverse;
int longfmt;
int matchargs;
int fullmatch;
+int cflags = REG_EXTENDED;
kvm_t *kd;
pid_t mypid;
@@ -158,7 +159,7 @@ main(int argc, char **argv)
criteria = 0;
- while ((ch = getopt(argc, argv, "G:P:U:d:fg:lns:t:u:vx")) != -1)
+ while ((ch = getopt(argc, argv, "G:P:U:d:fg:ilns:t:u:vx")) != -1)
switch (ch) {
case 'G':
makelist(&rgidlist, LT_GROUP, optarg);
@@ -184,6 +185,9 @@ main(int argc, char **argv)
makelist(&pgrplist, LT_PGRP, optarg);
criteria = 1;
break;
+ case 'i':
+ cflags |= REG_ICASE;
+ break;
case 'l':
if (!pgrep)
usage();
@@ -248,7 +252,7 @@ main(int argc, char **argv)
* Refine the selection.
*/
for (; *argv != NULL; argv++) {
- if ((rv = regcomp(&reg, *argv, REG_EXTENDED)) != 0) {
+ if ((rv = regcomp(&reg, *argv, cflags)) != 0) {
regerror(rv, &reg, buf, sizeof(buf));
errx(STATUS_BADUSAGE, "bad expression: %s", buf);
}
@@ -415,9 +419,9 @@ usage(void)
const char *ustr;
if (pgrep)
- ustr = "[-flnvx] [-d delim]";
+ ustr = "[-filnvx] [-d delim]";
else
- ustr = "[-signal] [-fnvx]";
+ ustr = "[-signal] [-finvx]";
fprintf(stderr, "usage: %s %s [-G gid] [-P ppid] [-U uid] [-g pgrp] "
"[-s sid] [-t tty] [-u euid] pattern ...\n", __progname, ustr);