summaryrefslogtreecommitdiffstats
path: root/usr.bin/grep
Commit message (Collapse)AuthorAgeFilesLines
* bsdgrep: Work-around for segmentation fault.pfg2014-09-251-1/+1
| | | | | | | | Fix by David Carlier. Obtained from: HardenedBSD PR: 167921 MFC after: 1 month
* Fix incremental builds involving non-root users with read-only source files.will2014-09-181-1/+1
| | | | | | | | | | | Makefiles should not assume that source files can be overwritten. This is the common case for Perforce source trees. This is a followup commit to r211243 in the same vein. MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: r1036319 on 2014/01/29, r1046711 on 2014/03/06
* - Do not look for more matching lines if -L is specifiedgabor2014-08-181-1/+1
| | | | | Submitted by: eadler (based on) MFC after: 2 weeks
* grep: fix some memory leaks.pfg2014-07-171-0/+1
| | | | | | Add memory leak fix missing from r268799. Obtained from: NetBSD
* grep: fix some memory leaks.pfg2014-07-172-7/+17
| | | | | | | | | | | | | | Bring a couple of changes from NetBSD: queue.c (CVS Rev. 1.4. 1.5) Fix memory leaks. NULL does not need a cast. grep.c (CVS Rev. 1.6) Use the more portable getline. Obtained from: NetBSD MFC after: 3 days
* grep: Fix type.pfg2014-07-171-1/+1
| | | | | Obtained from: NetBSD (CVS rev. 1.17) MFC after: 3 days
* Fix a bug in bsdgrep(1) where patterns are not correctlygjb2014-06-201-1/+1
| | | | | | | | | | | | | | | detected. Certain criteria must be met for this bug to show up: * the -w flag is specified, and * neither -o or --color are specified, and * the pattern is part of another word in the line, and * the other word that contains the pattern occurs first PR: 181973 MFC after: 3 days Sponsored by: The FreeBSD Foundation
* Use src.opts.mk in preference to bsd.own.mk except where we need stuffimp2014-05-061-1/+1
| | | | from the latter.
* Various style(9) fixes and typos in grep, sort and patch.pfg2014-04-213-29/+29
| | | | MFC after: 3 days
* Don't test WITHOUT_FOO in program makefiles, test MK_FOO instead.imp2014-04-011-4/+4
|
* mdoc: minor paragraph fixes.joel2014-02-081-1/+1
|
* grep -i does not work for simple patterns and single byte locales, likeache2013-07-301-2/+2
| | | | | | | LANG=ru_RU.KOI8-R grep -i <some single KOI8-R letter> Fix it. MFC after: 3 days
* Adjust CFLAGS to pick up correct regex.h and posix/regex.h. Note thisjkim2013-06-061-1/+1
| | | | | | actually reverts r250860 and r250861. Reported by: gjb, tinderbox
* Revert r246917, as it is causing incorrect behaviour as reported onmarkj2013-03-121-1/+1
| | | | | | | freebsd-current. PR: bin/175213 Approved by: emaste (co-mentor)
* Strengthen the check in IS_OUT_OF_BOUNDS to ensure that (j - 1) is amarkj2013-02-171-1/+1
| | | | | | | | | valid index into the input buffer. PR: bin/175213 Reviewed by: gabor Approved by: emaste (co-mentor) MFC after: 1 week
* - Avoid unnecessary strdup()gabor2013-01-201-2/+2
| | | | | Submitted by: ache MFC after: 5 days
* Following r226271, allow disabling lzma support with "WITHOUT_LZMA_SUPPORT".obrien2013-01-082-5/+19
| | | | | | Correct r226271 which should have used WITHOUT_BZIP2_SUPPORT per r166255. Obtained from: Juniper Networks
* Fix a segfault when bsdgrep -i is given an empty pattern string.markj2013-01-051-1/+1
| | | | | | | PR: bin/172865 Reviewed by: gabor Approved by: emaste (co-mentor) MFC after: 1 week
* - Fix handling of the case when multiple patterns are specified in a singlegabor2013-01-051-2/+12
| | | | | | | | command line argument, separated by newlines PR: bin/173673 Submitted by: ache MFC after: 1 week
* Make bsdgrep behave as gnugrep and as documented: -m should only stopeadler2012-12-203-3/+4
| | | | | | | | | reading the specific file, not any file. Tested by: frogs (irc) Reviewed by: gabor Approved by: cperciva (implicit) MFC after: 1 week
* More -Wmissing-variable-declarations fixes.ed2012-10-192-5/+6
| | | | | | | | | | | | | | | | In addition to adding `static' where possible: - bin/date: Move `retval' into extern.h to make it visible to date.c. - bin/ed: Move globally used variables into ed.h. - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings. - usr.bin/calendar: Remove unneeded variables. - usr.bin/chat: Make `line' local instead of global. - usr.bin/elfdump: Comment out unneeded function. - usr.bin/rlogin: Use _Noreturn instead of __dead2. - usr.bin/tset: Pull `Ospeed' into extern.h. - usr.sbin/mfiutil: Put global variables in mfiutil.h. - usr.sbin/pkg: Remove unused `os_corres'. - usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
* Remove duplicate line from usageeadler2012-01-151-1/+0
| | | | | | | PR: bin/164139 Submitted by: Yuri Pankov <yuri.pankov@gmail.com> Approved by: nwhitehorn MFC after: 3 days
* Add missing "static const" to long options table.ed2011-12-101-1/+1
| | | | | This table is only used in this C file and passed to getopt_long(), so we can safely add static and const to it.
* - Match GNU behavior of exit codegabor2011-12-073-6/+5
| | | | | | | | - Rename variable that has a different meaning now PR: bin/162930 Submitted by: Jan Beich <jbeich@tormail.net> MFC after: 1 week
* - Create links to the xz and lzma versions even if BSD grep is not thegabor2011-11-281-7/+8
| | | | | | | default. Nor GNU nor liblzma in base provides such functionality so it may be useful. MFC after: 3 days
* - Call warnx() instead of errx() if a directory is not readable when usinggabor2011-11-281-1/+3
| | | | | | | | a recursive search. This is the expected behavior instead of aborting. PR: bin/162907 Submitted by: Jan Beich <jbeich@tormail.net> MFC after: 3 days
* - Fix behavior of --null to match GNU grepgabor2011-11-281-5/+5
| | | | | | PR: bin/162906 Submitted by: Jan Beich <jbeich@tormail.net> MFC after: 3 days
* - Fix installation when WITH_BSD_GREP is set to yesgabor2011-10-231-0/+2
| | | | Submitted by: Aleksandr Rybalko <ray@ddteam.net>
* - Fix counting of match limit (-m)gabor2011-10-121-1/+1
| | | | | Reported by: Nali Toja <nalitoja@gmail.com> Approved by: delphij (mentor)
* - Use getprogname() instead of __prognamegabor2011-10-114-22/+43
| | | | | | | | - Allow disabling bzip2 support with WITHOUT_BZIP2 - Fix handling patterns that start with a dot - Remove superfluous semicolon Approved by: delphij (mentor)
* Fix build on i386 and arm.delphij2011-10-061-1/+1
| | | | | Tested with: make universe Pointy hat to: delphij
* Update BSD grep to the latest development version. It has some codegabor2011-10-0516-521/+2527
| | | | | | | | | | | | | backported that was written for the TRE integration project in Google Summer of Code 2011. This is a temporary solution until the whole regex library is not replaced so that BSD grep development can continue and the backported code gets some review and testing. This change only improves scalability slightly, there is no big performance boost yet but several minor bugs have been found and fixed. Approved by: delphij (mentor) Sposored by: Google Summer of Code 2011 MFC after: 1 week
* - Fix exclusion of directories from a recursive searchgabor2011-08-171-14/+5
| | | | | | | - Use FTS_SKIP for exclusion instead of custom code Submitted by: ttsestt@gmail.com Approved by: re (kib), delphij (mentor)
* - Fix handling of environmental variables when they are set to empty stringgabor2011-08-171-3/+4
| | | | | Submitted by: ttsestt@gmail.com Approved by: re (kib), delphij (mentor)
* - Use REG_NOSUB to bypass submatch counting when not necessary. This maygabor2011-06-122-2/+8
| | | | | | yield in somewhat better performance in a few cases. Approved by: delphij (mentor)
* - Fix -w behaviorgabor2011-06-122-14/+13
| | | | | | | | | - Make -F and -w work together - Fix --color to colorize all of the matches PR: bin/156826 Submitted by: Yuri Pankov <yuri.pankov@gmail.com> Approved by: delphij (mentor)
* Remove redundant assignments to WARNS.ed2011-06-061-2/+0
| | | | For these directories, WARNS is already implied to be 6.
* Build and install a BSD licensed grep.obrien2011-05-251-0/+11
| | | | | | | | If WITH_BSD_GREP is not set, it will be 'bsdgrep' and GNUgrep will be '[ef]grep'. Otherwise, BSD-grep will be the grep family, and GNUgrep will be 'gnugrep'. Discussed with: brooks
* - Adjust a comment to actual behaviourgabor2011-04-078-4/+19
| | | | | | | | | - Makefile nit - Add more CVS/SVN keywords to make it easier to track changes from NetBSD in case they add further improvements Approved by: delphij (mentor) Obtained from: The NetBSD Project
* - Simplify the fixed string pattern preprocessing codegabor2011-04-073-11/+12
| | | | | | | - Improve readability Approved by: delphij (mentor) Obtained from: The NetBSD Project
* - Replace some strcpy()-family functions with memcpy() ones. It has beengabor2011-04-071-5/+6
| | | | | | | | | discussed earlier that the extra safeness is not required in these cases and we can avoid the overhead by using the more general memory copy functions. Approved by: delphij (mentor) Obtained from: The NetBSD Project
* Add Simplified Chinese messages for BSD grep.delphij2010-09-202-0/+14
|
* Revert a minor part of revision 211364:delphij2010-08-191-4/+1
| | | | | | | | | | - Imply -h if single file is grepped, this is the GNU behaviour This is already done by code above the change and have caused a regression since this instance of code does not check Hflag. Reported by: davidxu Pointy hat to: delphij
* UTFize my name.des2010-08-196-6/+6
|
* - Refactor file reading code to use pure syscalls and an internal buffergabor2010-08-184-178/+157
| | | | | | | | instead of stdio. This gives BSD grep a very big performance boost, its speed is now almost comparable to GNU grep. Submitted by: Dimitry Andric <dimitry@andric.com> Approved by: delphij (mentor)
* - Revert strlcpy() changes to memcpy() because it's more efficient andgabor2010-08-156-66/+66
| | | | | | | | | | | | | | | | | | | | | | | former may be safer but in this case it doesn't add extra safety [1] - Fix -w option [2] - Fix handling of GREP_OPTIONS [3] - Fix --line-buffered - Make stdin input imply --line-buffered so that tail -f can be piped to grep [4] - Imply -h if single file is grepped, this is the GNU behaviour - Reduce locking overhead to gain some more performance [5] - Inline some functions to help the compiler better optimize the code - Use shortcut for empty files [6] PR: bin/149425 [6] Prodded by: jilles [1] Reported by: Alex Kozlov <spam@rm-rf.kiev.ua> [2] [3], swell.k@gmail.com [2], poyopoyo@puripuri.plala.or.jp [4] Submitted by: scf [5], Shuichi KITAGUCHI <ki@hh.iij4u.or.jp> [6] Approved by: delphij (mentor)
* - Some fixes to Ukranian cataloggabor2010-08-061-2/+2
| | | | Submitted by: avg, Alex Kozlov <spam@rm-rf.kiev.ua>
* Fix spelling.joel2010-07-301-1/+1
|
* - Add Ukranian cataloggabor2010-07-302-0/+13
| | | | Submitted by: Alex Kozlov <spam@rm-rf.kiev.ua>
* - Some minor changes to the messages to increase usefulness of error msgsgabor2010-07-2911-52/+38
| | | | | | Reviewed by: hrs (Japanese catalogs), pluknet <pluknet at gmail dot com> (Russian catalog) Approved by: delphij (mentor)
OpenPOWER on IntegriCloud