summaryrefslogtreecommitdiff
path: root/user/grep.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2019-09-05 16:50:55 -0400
committerRobert Morris <[email protected]>2019-09-05 16:50:55 -0400
commitfc337af2b6275d8b0b8bc41b5e2eb3619eb47bf1 (patch)
treea1154fa39457930c836834a50e119d31c8bfb754 /user/grep.c
parentc0beeccb1b46cfba7762740b901ca266adb65a6f (diff)
downloadxv6-labs-fc337af2b6275d8b0b8bc41b5e2eb3619eb47bf1.tar.gz
xv6-labs-fc337af2b6275d8b0b8bc41b5e2eb3619eb47bf1.tar.bz2
xv6-labs-fc337af2b6275d8b0b8bc41b5e2eb3619eb47bf1.zip
fix a grep bug
Diffstat (limited to 'user/grep.c')
-rw-r--r--user/grep.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/user/grep.c b/user/grep.c
index 152c8a8..5e1f2c0 100644
--- a/user/grep.c
+++ b/user/grep.c
@@ -26,8 +26,6 @@ grep(char *pattern, int fd)
}
p = q+1;
}
- if(p == buf)
- m = 0;
if(m > 0){
m -= p - buf;
memmove(buf, p, m);