summaryrefslogtreecommitdiff
path: root/usr.bin/grep/grep.h
AgeCommit message (Collapse)Author
2007-09-02use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsgTheo de Raadt
2006-02-09delint; remove redundant vars and functions; ok jaredy@Otto Moerbeek
2004-10-03Remove block based mmap optimization. There are newline problemsOtto Moerbeek
(PR 3940, 3941) which can be fixed, but if a match starts at the end of a block and continues into the next block, no match will be found. Measurements by millert@ showed that the improvements of this optimization are non-measurable anyway. Diff from Alexander Taler. ok millert@
2004-05-07Add a new past path for fgrep that is just a simplified version ofTodd C. Miller
fastcomp. This makes fgrep faster and fixes the -w flag w/ fgrep. Also remove free_patterns() since calling free right before exit is silly. Problem noticed by espie@
2004-01-25Previously, in -w mode, for each match on a line grep would checkTodd C. Miller
to see if the match was on a word boundary. However, this missed lines where the first match was not on a word boundary but a subsequent match was. Problem originally spotted by miod@ We fix this by using the [[:<:]] and [[:>:]] character classes for the slow path and by checking the word boundaries in grep_search() for the fast path instead of doing the checks after running regexec() or grep_search(). With this change, grep passes the new regress tests 15 and 16. problem originally spotted by espie@.
2004-01-19Use off_t for file sizes, and don't forget to print a ':' when usingOtto Moerbeek
the -b option. ok millert@
2003-07-02protosTheo de Raadt
2003-06-25o remove useless cast to int from gzread() callTodd C. Miller
o maxPatternLen should be size_t since that's what it is compared against o remove useless casts of NULL to various pointer types
2003-06-25Function prototypes that take no args should have (void) as the parameter.Todd C. Miller
2003-06-24actually do fgrep. -G -F and -E are now mutally exclusive, and overrideTed Unangst
the program name as expected. ok millert@
2003-06-23faster grep for simple patterns. derived from a patch by sean farley.Ted Unangst
this makes searching for constant strings much faster by avoiding regex. ok deraadt@
2003-06-23better detetection/handling of binary files.Ted Unangst
make -a do the right thing, doc and implement -U, -I. add --help and --mmap for compatibility. some other minor fixes. some from NetBSD. ok deraadt@
2003-06-22proper $OpenBSD$Theo de Raadt
2003-06-22freegrep 0.16Theo de Raadt