diff options
author | Russ Cox <rsc@swtch.com> | 2011-07-10 20:01:15 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2011-07-10 20:01:15 -0400 |
commit | ce5fdeb4469ecc6967d09d0aea9d29babb1ab5fc (patch) | |
tree | 8bbc3be8c07b2648bf7bd66d4eff33d2162a600f /src/cmd/grep | |
parent | 29fba8562cd8585a613046b509347c905642be16 (diff) | |
download | plan9port-ce5fdeb4469ecc6967d09d0aea9d29babb1ab5fc.tar.gz plan9port-ce5fdeb4469ecc6967d09d0aea9d29babb1ab5fc.tar.bz2 plan9port-ce5fdeb4469ecc6967d09d0aea9d29babb1ab5fc.zip |
grep: import $ fix from plan 9
R=rsc
http://codereview.appspot.com/4673053
Diffstat (limited to 'src/cmd/grep')
-rw-r--r-- | src/cmd/grep/comp.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cmd/grep/comp.c b/src/cmd/grep/comp.c index c3e1549a..241a4136 100644 --- a/src/cmd/grep/comp.c +++ b/src/cmd/grep/comp.c @@ -114,8 +114,14 @@ loop: break; case Tend: - if(c == '\n') - matched = 1; + if(c == '\n') { + if(r->next == 0) { + matched = 1; + break; + } + r = r->next; + goto loop; + } break; case Tclass: |