History log of /freebsd-10.0-release/usr.bin/grep/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


253810 30-Jul-2013 ache

grep -i does not work for simple patterns and single byte locales, like
LANG=ru_RU.KOI8-R grep -i <some single KOI8-R letter>
Fix it.

MFC after: 3 days


251468 06-Jun-2013 jkim

Adjust CFLAGS to pick up correct regex.h and posix/regex.h. Note this
actually reverts r250860 and r250861.

Reported by: gjb, tinderbox


248214 12-Mar-2013 markj

Revert r246917, as it is causing incorrect behaviour as reported on
freebsd-current.

PR: bin/175213
Approved by: emaste (co-mentor)


246917 17-Feb-2013 markj

Strengthen the check in IS_OUT_OF_BOUNDS to ensure that (j - 1) is a
valid index into the input buffer.

PR: bin/175213
Reviewed by: gabor
Approved by: emaste (co-mentor)
MFC after: 1 week


245688 20-Jan-2013 gabor

- Avoid unnecessary strdup()

Submitted by: ache
MFC after: 5 days


245171 08-Jan-2013 obrien

Following r226271, allow disabling lzma support with "WITHOUT_LZMA_SUPPORT".
Correct r226271 which should have used WITHOUT_BZIP2_SUPPORT per r166255.

Obtained from: Juniper Networks


245075 05-Jan-2013 markj

Fix a segfault when bsdgrep -i is given an empty pattern string.

PR: bin/172865
Reviewed by: gabor
Approved by: emaste (co-mentor)
MFC after: 1 week


245057 05-Jan-2013 gabor

- Fix handling of the case when multiple patterns are specified in a single
command line argument, separated by newlines

PR: bin/173673
Submitted by: ache
MFC after: 1 week


244493 20-Dec-2012 eadler

Make bsdgrep behave as gnugrep and as documented: -m should only stop
reading the specific file, not any file.

Tested by: frogs (irc)
Reviewed by: gabor
Approved by: cperciva (implicit)
MFC after: 1 week


241737 19-Oct-2012 ed

More -Wmissing-variable-declarations fixes.

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'.


230141 15-Jan-2012 eadler

Remove duplicate line from usage

PR: bin/164139
Submitted by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: nwhitehorn
MFC after: 3 days


228395 10-Dec-2011 ed

Add missing "static const" to long options table.

This table is only used in this C file and passed to getopt_long(), so
we can safely add static and const to it.


228319 07-Dec-2011 gabor

- Match GNU behavior of exit code
- Rename variable that has a different meaning now

PR: bin/162930
Submitted by: Jan Beich <jbeich@tormail.net>
MFC after: 1 week


228099 28-Nov-2011 gabor

- Create links to the xz and lzma versions even if BSD grep is not the
default. Nor GNU nor liblzma in base provides such functionality so
it may be useful.

MFC after: 3 days


228097 28-Nov-2011 gabor

- Call warnx() instead of errx() if a directory is not readable when using
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


228093 28-Nov-2011 gabor

- Fix behavior of --null to match GNU grep

PR: bin/162906
Submitted by: Jan Beich <jbeich@tormail.net>
MFC after: 3 days


226664 23-Oct-2011 gabor

- Fix installation when WITH_BSD_GREP is set to yes

Submitted by: Aleksandr Rybalko <ray@ddteam.net>


226273 12-Oct-2011 gabor

- Fix counting of match limit (-m)

Reported by: Nali Toja <nalitoja@gmail.com>
Approved by: delphij (mentor)


226271 11-Oct-2011 gabor

- Use getprogname() instead of __progname
- Allow disabling bzip2 support with WITHOUT_BZIP2
- Fix handling patterns that start with a dot
- Remove superfluous semicolon

Approved by: delphij (mentor)


226047 06-Oct-2011 delphij

Fix build on i386 and arm.

Tested with: make universe
Pointy hat to: delphij


226035 05-Oct-2011 gabor

Update BSD grep to the latest development version. It has some code
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


224938 17-Aug-2011 gabor

- Fix exclusion of directories from a recursive search
- Use FTS_SKIP for exclusion instead of custom code

Submitted by: ttsestt@gmail.com
Approved by: re (kib), delphij (mentor)


224937 17-Aug-2011 gabor

- Fix handling of environmental variables when they are set to empty string

Submitted by: ttsestt@gmail.com
Approved by: re (kib), delphij (mentor)


223009 12-Jun-2011 gabor

- Use REG_NOSUB to bypass submatch counting when not necessary. This may
yield in somewhat better performance in a few cases.

Approved by: delphij (mentor)


223008 12-Jun-2011 gabor

- Fix -w behavior
- 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)


222772 06-Jun-2011 ed

Remove redundant assignments to WARNS.

For these directories, WARNS is already implied to be 6.


222273 25-May-2011 obrien

Build and install a BSD licensed grep.
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


220422 07-Apr-2011 gabor

- Adjust a comment to actual behaviour
- 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


220421 07-Apr-2011 gabor

- Simplify the fixed string pattern preprocessing code
- Improve readability

Approved by: delphij (mentor)
Obtained from: The NetBSD Project


220420 07-Apr-2011 gabor

- Replace some strcpy()-family functions with memcpy() ones. It has been
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


212927 20-Sep-2010 delphij

Add Simplified Chinese messages for BSD grep.


211519 19-Aug-2010 delphij

Revert a minor part of revision 211364:

- 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


211496 19-Aug-2010 des

UTFize my name.


211463 18-Aug-2010 gabor

- Refactor file reading code to use pure syscalls and an internal buffer
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)


211364 15-Aug-2010 gabor

- Revert strlcpy() changes to memcpy() because it's more efficient and
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)


210927 06-Aug-2010 gabor

- Some fixes to Ukranian catalog

Submitted by: avg, Alex Kozlov <spam@rm-rf.kiev.ua>


210652 30-Jul-2010 joel

Fix spelling.


210639 30-Jul-2010 gabor

- Add Ukranian catalog

Submitted by: Alex Kozlov <spam@rm-rf.kiev.ua>


210622 29-Jul-2010 gabor

- Some minor changes to the messages to increase usefulness of error msgs

Reviewed by: hrs (Japanese catalogs),
pluknet <pluknet at gmail dot com> (Russian catalog)
Approved by: delphij (mentor)


210579 29-Jul-2010 gabor

- Add Japanese NLS catalogs

Submitted by: hrs
Approved by: delphij (mentor)


210578 29-Jul-2010 gabor

- Use the traditional behaviour for filename and directory name inclusion
and exclusion patterns [1]
- Some improvements on the exiting code, like replacing memcpy with
strlcpy/strcpy

Approved by: delphij (mentor)
Pointed out by: bf [1], des [1]


210479 25-Jul-2010 gabor

- Fix -l and -L by really surpressing output and just showing filenames

Submitted by: swell.k@gmail.com
Approved by: delphij (mentor)


210461 25-Jul-2010 gabor

- Fix --color behaviour to only output color sequences if stdout is a tty
or if forced mode is specified [1]
- While here, add some alternative names for the options and make then
case-insensitive
- Fix -q and -l behaviour [2]
- Some small changes to make the code easier to review

Submitted by: swell.k@gmail.com [1],
dougb [2]
Approved by: delphij (mentor)


210430 23-Jul-2010 delphij

Fix crashes when using grep -R:

- Explicitly pre-zero memory for fts_open parameters.
- Don't test against directory patterns when we are testing direct
leaf of current directory.

While I'm there plug a few of memory leaks.


210426 23-Jul-2010 gabor

- Add Russian catalog [1]
- Fix two minor nits in manpage [2]
- style.Makefile(5)

Submitted by: pluknet <pluknet at gmail.com> [1],
Alex Kozlov <spam@rm-rf.kiev.ua> [2]
Reviewed by: delphij


210389 22-Jul-2010 gabor

Add BSD grep to the base system and make it our default grep.

Deliverables: Small and clean code (1,4 KSLOC vs GNU's 8,5 KSLOC),
lower memory usage than GNU grep, GNU compatibility,
BSD license.

TODO: Performance is somewhat behind GNU grep but it is only
significant for bigger searches. The reason is complex, the
most important factor is that GNU grep uses lots of
optimizations to improve the speed of the regex library.
First, we need a modern regex library (practically by adopting
TRE), add support for GNU-style non-standard regexes and then
reevalute the performance issues and look for bottlenecks. In
the meantime, for those, who need better performance, it is
possible to build GNU grep by setting WITH_GNU_GREP.

Approved by: delphij (mentor)
Obtained from: OpenBSD (http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/grep/),
freegrep (http://github.com/howardjp/freegrep)
Sponsored by: Google SoC 2008
Portbuild tests run by: kris, pav, erwin
Acknowledgements to: fjoe (as SoC 2008 mentor),
everyone who helped in reviewing and testing