grep: import $ fix from plan 9

R=rsc
http://codereview.appspot.com/4673053
This commit is contained in:
Russ Cox 2011-07-10 20:01:15 -04:00
parent 29fba8562c
commit ce5fdeb446

View file

@ -114,9 +114,15 @@ loop:
break; break;
case Tend: case Tend:
if(c == '\n') if(c == '\n') {
if(r->next == 0) {
matched = 1; matched = 1;
break; break;
}
r = r->next;
goto loop;
}
break;
case Tclass: case Tclass:
if(c >= r->u.x.lo && c <= r->u.x.hi) if(c >= r->u.x.lo && c <= r->u.x.hi)