看板 FB_bugs 關於我們 聯絡資訊
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=165471 Mateusz Guzik <mjg@FreeBSD.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mjg@FreeBSD.org --- Comment #3 from Mateusz Guzik <mjg@FreeBSD.org> --- bsdgrep --mmap does not handle files without newlines at the end properly issue can be reproduced with: $ echo -n foo > file $ bsdgrep --mmap meh file I don't know this code and I'm not interested in changing it, but the following hack fixes: diff --git a/usr.bin/grep/file.c b/usr.bin/grep/file.c index 6bcaa52..f056697 100644 --- a/usr.bin/grep/file.c +++ b/usr.bin/grep/file.c @@ -83,12 +83,12 @@ grep_refill(struct file *f) { ssize_t nr; - if (filebehave == FILE_MMAP) - return (0); - bufpos = buffer; bufrem = 0; + if (filebehave == FILE_MMAP) + return (0); + if (filebehave == FILE_GZIP) { nr = gzread(gzbufdesc, b -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"