* grep -- print lines matching (or not matching) a pattern
while (--argc
> 0 && (++argv
)[0][0]=='-')
printf2("Unknown flag\n");
else while (--argc
>= 0) {
if (ep
>= &expbuf
[ESIZE
])
if ((c
= *sp
++) == '^') {
if (c
=='\0' || ep
>= &expbuf
[ESIZE
])
} while ((c
= *sp
++) != ']');
if ((f
= open(file
, 0)) < 0) {
printf2("Can't open %s\n", file
);
if ((c
= read(f
, ibuf
, 512)) <= 0) {
p1
= locv(tln
[0],tln
[1]);
if (p1
< &linebuf
[LBSIZE
-1])
/* fast check for first character */
register char *lp
, *ep
, *curlp
;
for (;;) switch (*ep
++) {
if (cclass(ep
, *lp
++, 1)) {
if (cclass(ep
, *lp
++, 0)) {
while (cclass(ep
, *lp
++, ep
[-1]==(CCL
|STAR
)));
printf("%s:", locv(lnum
[0], lnum
[1]));