=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/pkill/pkill.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/usr.bin/pkill/pkill.c 2005/03/02 21:45:53 1.9 +++ src/usr.bin/pkill/pkill.c 2005/03/27 14:50:09 1.10 @@ -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 @@ -94,6 +94,7 @@ int longfmt; int matchargs; int fullmatch; +int cflags = REG_EXTENDED; kvm_t *kd; pid_t mypid; @@ -158,7 +159,7 @@ 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 @@ makelist(&pgrplist, LT_PGRP, optarg); criteria = 1; break; + case 'i': + cflags |= REG_ICASE; + break; case 'l': if (!pgrep) usage(); @@ -248,7 +252,7 @@ * Refine the selection. */ for (; *argv != NULL; argv++) { - if ((rv = regcomp(®, *argv, REG_EXTENDED)) != 0) { + if ((rv = regcomp(®, *argv, cflags)) != 0) { regerror(rv, ®, buf, sizeof(buf)); errx(STATUS_BADUSAGE, "bad expression: %s", buf); } @@ -415,9 +419,9 @@ 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);