Age | Commit message (Collapse) | Author | |
---|---|---|---|
2017-04-03 | initialize regmatch_t always, fixes grep -o "" | Ted Unangst | |
from Michael Santos | |||
2016-08-25 | when using -o, we may restart a match in the middle of the line. | Ted Unangst | |
set NOTBOL so that anchored patterns don't match. from a patch by Daniël de Kok in freebsd bug 201650 ok martijn | |||
2016-04-04 | Reverse search optimization makes no sense (and doesn't work) if | Otto Moerbeek | |
we are looking for all matches in a line; ok natano@ miilert@ tedu@ | |||
2016-03-30 | for some time now mandoc has not required MLINKS to function | Jason McIntyre | |
correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung | |||
2015-12-22 | cast toupper's argument to unsigned char | mmcc | |
ok millert@ | |||
2015-12-22 | The loop index in grep_cmp() should be size_t to match the type of | Todd C. Miller | |
the length parameter. The return value of grep_cmp() is only used in a boolean context so make it return bool instead of the index. OK mmcc@ | |||
2015-12-14 | Use long long rather than off_t for line_no to ensure that it's always | mmcc | |
64 bits. ok kettenis@ | |||
2015-12-07 | Represent line numbers with off_t rather than int. This prevents | mmcc | |
overflow on huge inputs. ok millert@, deraadt@ | |||
2015-11-28 | fix exit status on pledge(2) error, where it should be >1 | Gleydson Soares | |
OK millert@ deraadt@ | |||
2015-10-09 | Change all tame callers to namechange to pledge(2). | Theo de Raadt | |
2015-10-03 | grep only opens files read-only, reads via stdio or other methods, performs | Theo de Raadt | |
computation, and outputs result to stdout. (note: in the tame model, malloc is implicit because stdio needs it, and mmap is implicit since malloc needs it; libz is satisfied by this environment also). this tame change consists of 1 line, setting "stdio rpath" before getopt. this protection is fairly strict. grep could be improved further by computing a wpathlist based on argv, keeping -R in mind. feel free to take a shot at it. grep was an early target of capsicum also. know anyone running capsicum grep? ok doug | |||
2015-08-27 | use strtonum to parse the number of lines of context. | David Gwynne | |
this provides better error messages. ok deraadt@ guenther@ | |||
2015-06-25 | Put fts_close() where missing. | Masao Uebayashi | |
Not bugs in short-lived commands that call exit() -> _exit() immediately, but for idempotency. Originally found in ls(1) by Valgrind. Changes for other commands are from deraadt@. Reviewed by me, tested in snapshots. OK deraadt@ | |||
2015-04-30 | Add warning when user specifies -R but no files, like GNU grep. | Todd C. Miller | |
OK schwarze@ ian@ | |||
2015-03-16 | Don't include limits.h or sys/limits.h since grep.h already does it | Todd C. Miller | |
for us. | |||
2015-03-16 | Include limits.h, not sys/limits.h and include stdint.h for SIZE_MAX. | Todd C. Miller | |
2015-02-06 | SIZE_MAX is standard, we should be using it in preference to the | Todd C. Miller | |
obsolete SIZE_T_MAX. OK miod@ beck@ | |||
2015-01-16 | Replace <sys/param.h> with <limits.h> and other less dirty headers where | Theo de Raadt | |
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol) | |||
2015-01-13 | An article on medium.com highlighted that grep | Daniel Dickman | |
was available in v4. To quote Ken Thompson, grep appeared "sometime before the 4th edition." ok schwarze@ | |||
2015-01-10 | 1. They're flags, not counters. Set to one instead of incrementing. | Ted Unangst | |
2. The G flag is useless and never checked. Remove it. ok millert | |||
2014-12-01 | use reallocarray() | Theo de Raadt | |
2014-11-26 | Prefer setvbuf() to setlinebuf() for portability; ok deraadt@ | Todd C. Miller | |
2014-11-26 | Make option string/struct const (since it is...). I've had this | Todd C. Miller | |
in my tree for ages. | |||
2014-11-08 | Check the mode flag being passed in to mmopen() instead of ignoring it. | Brad Smith | |
Pointed out by LLVM. mmfile.c:51:7: warning: explicitly assigning a variable of type 'char *' to itself [-Wself-assign] ok millert@ | |||
2014-05-20 | Use errc/warnc to simplify code. | Philip Guenther | |
Also, in 'ftp', always put the error message last, after the hostname/ipaddr. ok jsing@ krw@ millert@ | |||
2013-11-26 | unsigned char casts for ctype | Theo de Raadt | |
ok krw | |||
2013-11-12 | simple prototype repairs | Theo de Raadt | |
2013-05-04 | blacklist a select few characters instead of a limited whitelist for | Ted Unangst | |
detecting non-regex patterns. makes the fast grep code more applicable. with some improvements by Jeremie Courreges-Anglas | |||
2013-01-17 | remove uesless Pp; | Jason McIntyre | |
2012-12-29 | Fix exit status when there is an error reading a file. | Todd C. Miller | |
Reported by Jeramey Crawford, fix adapted from FreeBSD. OK guenther@ | |||
2012-12-12 | Don't print zero length matches in -o mode. Found by otto@ who | Todd C. Miller | |
initially proposed a different fix. OK otto@ | |||
2012-12-11 | use proper eol offset for -o matching; spotted by ajacoutot@; ok millert@ | Otto Moerbeek | |
2011-07-17 | Fix an integer overflow for very long lines by replacing the datatype of 2 ↵ | aschrijver | |
offsets from int to regoff_t. Bail if the given size_t line length doesn't fit into the new regoff_t. "I don't think you will ever be able to get a string longer than SSIZE_MAX into memory, but that looks good." tedu@ "Agreed" otto@ regoff_t suggested by otto@ | |||
2011-07-17 | Fix spacing | aschrijver | |
OK otto@ | |||
2011-07-11 | the matchall magic shortcut requires we set c=1 to print now | Ted Unangst | |
fixes libpqxx build | |||
2011-07-08 | add support for -o to only print the match. | Ted Unangst | |
reminded this was useful by ajcoutot | |||
2011-06-20 | Switch binary file detection from !(isprint() || isspace()) to checking | Stefan Sperling | |
for embedded NULs. Matches GNU and FreeBSD grep, and avoids problems with e.g. latin1-encoded files being treated as binary in the UTF-8 locale once grep calls setlocale() (which it does not, yet). OK millert@ tedu@ | |||
2011-03-04 | add -H (opposite of -h) to always print name. ok deraadt millert | Ted Unangst | |
2010-09-03 | add an EXIT STATUS section for /usr/bin; | Jason McIntyre | |
2010-07-02 | Remove the "fast" grep code if SMALL. This has the side effect of breaking | Ted Unangst | |
fgrep -w, but oh well. ok deraadt millert | |||
2010-07-02 | Do not include mmap support with -DSMALL. | Nicholas Marriott | |
ok millert | |||
2010-04-25 | prevent out-of-bounds access with empty pattern (fixes "grep -x ''") | Eric Faurot | |
ok millert@ krw@ | |||
2010-04-20 | Fix "grep -e foo -w" crash. The problem lies in 'e' getopt clause | Jacek Masiulaniec | |
calling add_pattern, which in turn assumes that the getopt phase has already finished. OK otto@ | |||
2010-04-05 | make this page read a little better; | Jason McIntyre | |
2010-04-05 | remove some non-POSIX standard non-GNU defacto standard options, mostly | Ted Unangst | |
relating to symlinks that you can get with find. And a bonus fts flag fix. With a small tweak by guenther. ok deraadt guenther jmc millert nicm | |||
2009-02-08 | bump the posix reference in STANDARDS to IEEE Std 1003.1-2008, with a few | Jason McIntyre | |
updates to follow; | |||
2008-10-16 | two globals not needed in NOZ mode | Theo de Raadt | |
2007-10-02 | Process patterns containing $ end ^ (but not as last or first char) | Otto Moerbeek | |
using regcomp() instead of fastcomp(). ok millert@ | |||
2007-09-02 | use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg | Theo de Raadt | |
2007-05-31 | convert to new .Dd format; | Jason McIntyre | |