summaryrefslogtreecommitdiff
path: root/usr.bin/grep/util.c
AgeCommit message (Expand)Author
2014-05-20Use errc/warnc to simplify code.Philip Guenther
2013-11-26unsigned char casts for ctypeTheo de Raadt
2013-05-04blacklist a select few characters instead of a limited whitelist forTed Unangst
2012-12-29Fix exit status when there is an error reading a file.Todd C. Miller
2012-12-12Don't print zero length matches in -o mode. Found by otto@ whoTodd C. Miller
2012-12-11use proper eol offset for -o matching; spotted by ajacoutot@; ok millert@Otto Moerbeek
2011-07-17Fix an integer overflow for very long lines by replacing the datatype of 2 of...aschrijver
2011-07-11the matchall magic shortcut requires we set c=1 to print nowTed Unangst
2011-07-08add support for -o to only print the match.Ted Unangst
2010-07-02Remove the "fast" grep code if SMALL. This has the side effect of breakingTed Unangst
2010-04-25prevent out-of-bounds access with empty pattern (fixes "grep -x ''")Eric Faurot
2010-04-05remove some non-POSIX standard non-GNU defacto standard options, mostlyTed Unangst
2007-10-02Process patterns containing $ end ^ (but not as last or first char)Otto Moerbeek
2007-09-02use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsgTheo de Raadt
2006-12-26fts_read returning NULL and errno set is an error. ok ray@Otto Moerbeek
2006-11-17Reset the number of lines of tail context left to printJared Yanovich
2006-09-26Allow zero-length patterns with -x soJared Yanovich
2006-02-09delint; remove redundant vars and functions; ok jaredy@Otto Moerbeek
2005-04-03Protect begin and end of word markers added to the pattern whenOtto Moerbeek
2004-10-03Remove block based mmap optimization. There are newline problemsOtto Moerbeek
2004-09-16unused variables; otto okTheo de Raadt
2004-08-11Stop search when -q option is given and a match is found. Found by jmc@Otto Moerbeek
2004-05-07Make grep -w behave the same for the fastcomp and the regex case,Otto Moerbeek
2004-05-07Add a new past path for fgrep that is just a simplified version ofTodd C. Miller
2004-02-04Fix anchors (^ or $) in -w mode broken by the last commit's -w overhaul.Todd C. Miller
2004-01-26dataLen should be size_t to match l->len; ok otto@ tedu@Todd C. Miller
2004-01-25Previously, in -w mode, for each match on a line grep would checkTodd C. Miller
2004-01-19Use off_t for file sizes, and don't forget to print a ':' when usingOtto Moerbeek
2004-01-18make sure ln.len gets initialized. Okay millert@Marc Espie
2003-12-06Unbreak grepping for some patterns containing multiple dots. Fixes PR 3597.Otto Moerbeek
2003-10-28prototype declared static, but function was not. add static to function.Anil Madhavapeddy
2003-07-20After some discussion on icb it seems a do {} while is what we wantTodd C. Miller
2003-07-20Close PR 3358 by changing the loop from do {} while -> for; tdeval@ OKTodd C. Miller
2003-07-10restore grep -v semantics, print lines that don't match any (mismatch all)Daniel Hartmeier
2003-07-10grep should exit(2) on error, not exit(1) (1 means no matches found).Todd C. Miller
2003-07-06no need to redefine strlcpy here; millert@ okAnil Madhavapeddy
2003-07-01Fix bounds check in the fast grep code that caused an incorrectTodd C. Miller
2003-06-25o remove useless cast to int from gzread() callTodd C. Miller
2003-06-25knfTheo de Raadt
2003-06-24Make 'grep -w' work; OK tedu@Todd C. Miller
2003-06-24actually do fgrep. -G -F and -E are now mutally exclusive, and overrideTed Unangst
2003-06-24don't print "Binary file matches" with -q flag. from Sean FarleyTed Unangst
2003-06-23faster grep for simple patterns. derived from a patch by sean farley.Ted Unangst
2003-06-23minor tweaksTheo de Raadt
2003-06-23better detetection/handling of binary files.Ted Unangst
2003-06-22proper $OpenBSD$Theo de Raadt
2003-06-22-DNOZ flag to be used by install media for removing z*grep support, ifTheo de Raadt
2003-06-22freegrep 0.16Theo de Raadt