summaryrefslogtreecommitdiffstats
path: root/usr.bin/grep/binary.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* zlib functions take a gzFile not gzFile * (gzFile is already a pointer).millert2021-03-101-2/+2
| | | | From Josh Rickmar.
* simple prototype repairsderaadt2013-11-121-2/+2
|
* Switch binary file detection from !(isprint() || isspace()) to checkingstsp2011-06-201-20/+14
| | | | | | | 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@
* Do not include mmap support with -DSMALL.nicm2010-07-021-1/+3
| | | | ok millert
* - use size_t where appropriate.otto2005-04-251-4/+4
| | | | | - check for <= 0 in gzread; it returns -1 on error. From christos@netbsd; ok millert@
* Due to a braindead zlib, the test for seekability of a gzstream usingotto2005-02-071-3/+5
| | | | | | gzseek(f, 0L, SEEK_CUR) does not work as expected. Instead test the underlying stream and remember that. This repairs echo foo | gzip | zgrep foo. Problem spotted by Han Boetes in PR 4089; ok millert@
* cast offset value correctly for gzseekderaadt2004-09-151-2/+2
|
* Don't fseek() on stdin if it is a terminal. It does not fail, butotto2004-05-061-2/+2
| | | | | | what's more more important, it does not work either. ok millert@ tedu@
* Treat ^H as non-binary. OK hshoexer@, brad@ and deraadt@millert2004-05-061-4/+6
|
* fix zgrep failure when the uncompressed file begins with a newlinecanacar2003-12-291-8/+13
| | | | | | also, search from the beginning if a stream or compressed file is identified as 'binary'. ok millert@, reported by tedu@, tested by jose@
* make this test look for spaces as well, to match other casesbeck2003-09-181-2/+2
| | | | ok fgs@ ok deraadt@
* extend ascii test for more accuracy. ok deraadt@ pb@tedu2003-09-071-8/+6
|
* o remove useless cast to int from gzread() callmillert2003-06-251-2/+2
| | | | | o maxPatternLen should be size_t since that's what it is compared against o remove useless casts of NULL to various pointer types
* backwards args to gzseektedu2003-06-251-2/+2
|
* better detetection/handling of binary files.tedu2003-06-231-2/+2
| | | | | | | | 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@
* proper $OpenBSD$deraadt2003-06-221-2/+2
|
* -DNOZ flag to be used by install media for removing z*grep support, ifderaadt2003-06-221-2/+4
| | | | needed. (and knf)
* correct fseek() parametersderaadt2003-06-221-2/+2
|
* freegrep 0.16deraadt2003-06-221-0/+88