Commit Graph

161 Commits

Author SHA1 Message Date
David E. O'Brien
c34acf4a4c Fix regression in output with -R compared to previous version.
PR:		77466
Submitted by:	Andre Guibert de Bruet <andy@siliconlandmark.com>
2005-02-13 23:07:30 +00:00
Giorgos Keramidas
e23bfceab5 The correct name of the long option is --line-buffered,
not --line-bufferring.

PR:		docs/72985
Submitted by:	John Engelhart <johne@zang.com>
MFC after:	1 week
2004-11-09 17:00:06 +00:00
Tim J. Robbins
bfdbe5d98d Change version string to distinguish our modified version of GNU grep
from the original.
2004-08-12 06:45:31 +00:00
Tim J. Robbins
95cc51cfbd Fix bug causing `[' to be wrongly included in character class expressions
in some multibyte locales (Red Hat bug #108484).

Obtained from:	Fedora (Tim Waugh)
2004-07-04 16:25:41 +00:00
Tim J. Robbins
2af417add4 Make grep run much (~10x) faster in multibyte locales by caching the wide
character representation of input data across calls to dfaexec(), and by
caching the lengths of character across calls to check_multibyte_string().

Obtained from:	Fedora (Tim Waugh)
2004-07-04 16:16:59 +00:00
Tim J. Robbins
7358ecc6b6 Avoid accessing accessing memory past the end of mb_properties in the
degenerate case of fgrep with an empty pattern in a multibyte locale.
Found by phkmalloc.
2004-07-04 14:00:25 +00:00
Tim J. Robbins
91a4826a49 Improve case-insensitive matching in multibyte locales.
Obtained from:	Isamu Hasegawa (IBM) via Fedora
2004-07-04 11:58:10 +00:00
Tim J. Robbins
a7e3f3f0db Fix failure of fgrep to report some matches (Red Hat bug #116909).
Obtained from:	Fedora (Tim Waugh)
2004-07-04 11:33:49 +00:00
Tim J. Robbins
dddd0d87a3 Use hard_locale() to check whether collating order is "hard" regardless
of whether NLS is enabled.
2004-07-04 10:24:48 +00:00
Tim J. Robbins
1188285e9b Ignore ENABLE_NLS when deciding whether we can use setlocale().
Use the same shortcut as glibc to test for the "C" or "POSIX" locale.
2004-07-04 10:22:50 +00:00
Tim J. Robbins
19b0d58f6f Update for grep 2.5.1. 2004-07-04 10:05:37 +00:00
Tim J. Robbins
e5978bf334 Merge local changes. 2004-07-04 10:02:03 +00:00
Tim J. Robbins
d1e9179e8c This commit was generated by cvs2svn to compensate for changes in r131554,
which included commits to RCS files with non-trunk default branches.
2004-07-04 09:52:08 +00:00
Tim J. Robbins
6fdbbb5487 Import GNU grep 2.5.1 (trimmed) 2004-07-04 09:52:08 +00:00
Andrey A. Chernov
0416b7503d Merge conflicts, upgrade 2004-03-01 08:37:20 +00:00
Andrey A. Chernov
7a39f4da90 Trimmed grep 2.4.2 2004-03-01 08:24:49 +00:00
Andrey A. Chernov
cdd3ecb3a1 This commit was generated by cvs2svn to compensate for changes in r126432,
which included commits to RCS files with non-trunk default branches.
2004-03-01 08:24:49 +00:00
Andrey A. Chernov
49b4df9afb Oops, use -I${DESTDIR}/usr/include/gnu instead of ... /../../include/gnu 2004-02-17 05:38:45 +00:00
Andrey A. Chernov
90fc35042b 1) Remove files no longer needed.
2) Switch back to regex.h
2004-02-16 22:43:05 +00:00
Ruslan Ermilov
47d7e8a96f Fixed style of DPADD and LDADD assignments as per style.Makefile(5). 2004-02-05 22:44:25 +00:00
David E. O'Brien
597e16e012 We HAVE_STPCPY now. 2002-10-20 07:50:20 +00:00
Ruslan Ermilov
d40fe4078a Added bzip2 variants to the NAME section.
Added missing break.
Remove the statement that -J requires zlib(3).
2002-10-07 09:08:07 +00:00
David E. O'Brien
0bd38bab78 Allow -J to simultaneously do non-bzip2 grepping.
Don't allow -J and -Z together.

Partially submitted by:	knu
2002-10-06 07:02:30 +00:00
David E. O'Brien
089f14a27a Create bzgrep. 2002-09-16 04:27:29 +00:00
Giorgos Keramidas
e81b47f153 Typo in [^[:alnum:]] character class.
PR:		docs/41728
Submitted by:	osgene@web.de
2002-08-31 02:26:19 +00:00
Giorgos Keramidas
d2a4ebc11d Mention zegrep and zfgrep too,
and what their equivalent grep options are.

PR:		docs/35603
Submitted by:	"Gary W. Swearingen" <swear@blarg.net>
2002-07-11 20:12:15 +00:00
Ruslan Ermilov
b4c43aef50 Removed glibc specific stuff.
PR:		docs/31431
2001-11-27 08:23:38 +00:00
Ruslan Ermilov
096f9ef53b In FreeBSD, -Z is reserved for zgrep(1), and only
a long version of the --null option is supported.

PR:		gnu/30644
2001-09-19 07:22:30 +00:00
Dima Dorfman
70d51341bf mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
Ruslan Ermilov
ced1e16b18 This file was not regenerated for the latest import, thus the
reported grep version is wrong.  The correct version is 2.4d.
2000-12-13 15:54:14 +00:00
Ruslan Ermilov
17cbfdc259 Restore backwards compatible -R option.
Broken in revision 1.17.

Noticed by:	hoek
2000-05-30 10:50:15 +00:00
Ruslan Ermilov
73d1eabc26 Merge FreeBSD changes into 2.4d. 2000-01-31 13:28:57 +00:00
Ruslan Ermilov
7e1d495350 Merge FreeBSD changes into 2.4d.
FreeBSD changes OBE'ed by 2.4d:
* rev 1.5 - use collate for alpha character ranges.
2000-01-31 13:28:08 +00:00
Ruslan Ermilov
204aabd910 This is the stock GNU grep 2.4d file. 2000-01-31 13:26:10 +00:00
Ruslan Ermilov
7898cc4c8d Virgin import of a trimmed down GNU Grep 2.4d. 2000-01-31 13:22:22 +00:00
Ruslan Ermilov
cb22a7128a This commit was generated by cvs2svn to compensate for changes in r56915,
which included commits to RCS files with non-trunk default branches.
2000-01-31 13:22:22 +00:00
Ruslan Ermilov
c9746255c9 Back out previous revision because someone upgraded our
texinfo system to one that understands "command{foo}".
2000-01-18 09:52:00 +00:00
Ruslan Ermilov
1331c61815 Fix conflicts. 2000-01-18 09:46:39 +00:00
Ruslan Ermilov
d513cb6cd3 Virgin import of a trimmed down GNU Grep 2.4a. 2000-01-18 09:45:11 +00:00
Ruslan Ermilov
5a5a4819e3 This commit was generated by cvs2svn to compensate for changes in r56230,
which included commits to RCS files with non-trunk default branches.
2000-01-18 09:45:11 +00:00
Ruslan Ermilov
355f9b3c5d Decompression is supported via -Z, not -z. 2000-01-04 10:34:27 +00:00
Ruslan Ermilov
95a9e62800 * Make --null option work in (HAVE_LIBZ > 0) case.
* Remove "why we need this decl..." comment.  The `matcher' variable
  is defined in *grepmat.c files in the original distribution, which
  we did not import.
2000-01-04 10:32:55 +00:00
David E. O'Brien
22b1762487 Update for version 2.4. 2000-01-04 03:37:56 +00:00
David E. O'Brien
ca14eaae36 Turn off GNU Info docs until someone upgrades our texinfo system to one
that understands "command{foo}".
2000-01-04 03:27:32 +00:00
David E. O'Brien
7e5b33c6cd Merge FreeBSD chagnes into GNU grep 2.4. 2000-01-04 03:25:40 +00:00
David E. O'Brien
9ca25a7fa0 Virgin import of a trimmed down GNU Grep 2.4. 2000-01-03 21:09:05 +00:00
David E. O'Brien
582fb0dece This commit was generated by cvs2svn to compensate for changes in r55360,
which included commits to RCS files with non-trunk default branches.
2000-01-03 21:09:05 +00:00
David E. O'Brien
fc9e6f421e Virgin import of a trimmed down GNU Grep 2.3. 2000-01-03 21:07:51 +00:00
David E. O'Brien
d4fd9eb867 This commit was generated by cvs2svn to compensate for changes in r55357,
which included commits to RCS files with non-trunk default branches.
2000-01-03 21:07:51 +00:00
Ruslan Ermilov
4441e614bb This is the stock 2.3 file. Since someone majorly SPAMMED the
repository by NOT vendor importing the virgin 2.0 sources, CVS
had no idea what to do here.
1999-12-30 19:30:26 +00:00
Ruslan Ermilov
5567dff69e Virgin import of a trimmed down GNU Grep 2.3.
It is being re-imported here, to keep our long source change history with
this source continuous.
src/contrib/grep will be deleted some time in the very near future.
1999-12-30 19:19:37 +00:00
David E. O'Brien
07bdb1554d Support the environtmental var "GREP_OPTIONS". Which can hold a set of
default options for diff.  These options are interpreted first and can be
overwritten by explicit command line parameters.

Obtained from:	GNU Grep 2.3h
1999-11-26 03:26:59 +00:00
David E. O'Brien
3c6c025dba GNU killed this sometime before 2.3. 1999-11-24 15:11:51 +00:00
David E. O'Brien
ab473c8a50 Missed two.
Submitted by:	Philippe Charnier <charnier@xp11.frmug.org>
1999-11-22 20:03:01 +00:00
David E. O'Brien
6b769ae793 Virgin import of GNU Grep 2.3 [trimmed down]. 1999-11-22 10:31:17 +00:00
David E. O'Brien
06adfd11a1 This commit was generated by cvs2svn to compensate for changes in r53574,
which included commits to RCS files with non-trunk default branches.
1999-11-22 10:31:17 +00:00
David E. O'Brien
446b097ec8 Make the tests work again. 1999-11-22 09:48:04 +00:00
David E. O'Brien
cb8edeb588 spencer.tests is now spencer1.tests. The other files aren't part of
GNU Grep any longer.
1999-11-22 09:43:15 +00:00
David E. O'Brien
e0e99c88a7 Virgin import of GNU Grep 2.3 [trimmed down]. 1999-11-22 09:32:57 +00:00
David E. O'Brien
5032ef7fec This commit was generated by cvs2svn to compensate for changes in r53568,
which included commits to RCS files with non-trunk default branches.
1999-11-22 09:32:57 +00:00
David E. O'Brien
0630279783 Finish proper hookup of GNU Grep 2.3, including docs & config header file,
rather than the compile commandline from hell.

Submitted by:	ru
1999-11-22 09:13:43 +00:00
David E. O'Brien
07e1e6193e Build and install GNU Grep 2.3 docs. 1999-11-22 08:56:30 +00:00
David E. O'Brien
349c680aa7 Virgin import of a trimmed down GNU Grep 2.3. 1999-11-22 08:53:32 +00:00
David E. O'Brien
d025145f7a This commit was generated by cvs2svn to compensate for changes in r53564,
which included commits to RCS files with non-trunk default branches.
1999-11-22 08:53:32 +00:00
David E. O'Brien
f90c9f8e9e Restore the 2.3 config file. 1999-11-21 19:10:50 +00:00
Peter Wemm
bce3d5b6ef Apply a bandaid to the grep Makefile to try and get it to compile and stop
breaking world.
1999-11-21 09:44:26 +00:00
David E. O'Brien
75b7d1d0ef Spell command names correctly. Even when they appear at the beginning
of a sentence.
1999-11-21 02:00:16 +00:00
David E. O'Brien
5b104c31b2 Merge FreeBSD changes into 2.3:
* revs 1.5-6 - added builtin decompression using zlib library, option -Z.

Submitted by:	ru
1999-11-21 01:55:21 +00:00
David E. O'Brien
678b4e4854 Virgin import of a trimmed down GNU Grep 2.3.
It is being re-imported here, to keep our long source change history with
this source continuous.
src/contrib/grep will be deleted some time in the very near future.
1999-11-21 01:50:08 +00:00
David E. O'Brien
dd5c240f7a Merge FreeBSD changes into 2.3:
* rev 1.2 - use -lgnuregex

FreeBSD changes OBE'ed by 2.3:
* revs 1.4-5 - icase searches & ctype macro changes, fuctionality moved
               elsewhere.
* rev 1.3 - Remove trailing whitespace.  The GNU Grep maintainers did this
            for us.

Submitted by:	ru
1999-11-21 01:15:40 +00:00
David E. O'Brien
8d50785029 Alias -R to -r for backward compatibility.
Submitted by:	ru
Requested by:	wosch
1999-11-21 01:09:03 +00:00
David E. O'Brien
435811113f Set default matcher from argv[0].
Merge FreeBSD changes into 2.3:
* revs 1.9-10 - built-in decompression using zlib(3) library

FreeBSD changes OBE'ed by 2.3:
* rev 1.7 - our "-q" flag.  Use "-L" or "-l" now.
* revs 1.{4,6} - colleate, and with correct LC_ type.
* rev 1.3 - remove trailing whitespace.

Submitted by:	ru
1999-11-21 01:02:48 +00:00
David E. O'Brien
4d0ccc8353 This is the stock 2.3 file (+ FreeBSD id). Since someone added 2.0 rather
than vendor importing the virgin 2.0 sources, we have to manually put this
on the HEAD branch.
1999-11-20 23:42:44 +00:00
David E. O'Brien
54d8658575 This is the stock 2.3 file (+ FreeBSD id). Since someone majorly SPAMMED
the repository by NOT vendor importing the virgin 2.0 sources, CVS had no
idea what to do here.
1999-11-20 23:41:24 +00:00
David E. O'Brien
651d50a82f This is the stock 2.3 file (+ FreeBSD id). Since someone majorly SPAMMED
the repository by NOT vendor importing the virgin 2.0 sources, CVS had no
idea what to do here.
1999-11-20 23:16:11 +00:00
David E. O'Brien
7423a9f8e9 Merge FreeBSD changes into 2.3:
* rev 1.5 - use collate for alpha character ranges
* rev 1.3 - use -lgnuregex

Submitted by: ru
1999-11-20 23:09:17 +00:00
David E. O'Brien
c0e0ea0037 Virgin import of a trimmed down GNU Grep 2.3.
It is being re-imported here, to keep our long source change history with
this source continuous.
src/contrib/grep will be deleted some time in the very near future.
1999-11-20 18:37:42 +00:00
David E. O'Brien
2186a02c95 This commit was generated by cvs2svn to compensate for changes in r53469,
which included commits to RCS files with non-trunk default branches.
1999-11-20 18:37:42 +00:00
Peter Wemm
c18f2d82a5 Back out the botched attempt to update to gnu grep 2.3 (lots of history
was lost).  Restore original version to try and avoid breaking the build
while David O'brien does a proper set of imports and merges.

Requested by:	obrien
1999-11-20 09:40:28 +00:00
Ruslan Ermilov
be59282c27 Upgrade grep to version 2.3 1999-10-28 10:34:55 +00:00
Ruslan Ermilov
a4e449c8a3 Cast tp[-2] to unsigned char before comparing.
PR:		14011
Ignored by:	maintainer
Obtained from:	GNU grep 2.3
1999-10-13 12:06:35 +00:00
Peter Wemm
9b7a44a60e $Id$ -> $FreeBSD$ 1999-08-27 23:37:10 +00:00
Wolfram Schneider
1c9a0db841 Added myself as maintainer. 1999-02-09 17:23:03 +00:00
Wolfram Schneider
3067a7048b Use mmap for reading files. This is faster than read(). 1998-11-14 23:37:32 +00:00
David E. O'Brien
27d73120d4 Install z*grep manpages 1998-10-02 07:14:32 +00:00
Bruce Evans
2512f2fe3b Fixed printf format errors. 1998-06-30 20:14:13 +00:00
Wolfram Schneider
32dcb97f3e Delete cc(1) debug option, typo from last commit.
Pointed out by: Søren Schmidt
1998-03-07 16:13:57 +00:00
Wolfram Schneider
15ec2a04f8 When called as `zgrep', the -Z argument is assumed. Make a
link from zgrep to grep.

Pointed out by: Tim Vanderhoek <hoek@hwcn.org> and
                Mike Smith <mike@smith.net.au>
1997-12-21 19:15:12 +00:00
Wolfram Schneider
a6f4e3c4dc Added builtin decompression using zlib library, option -Z.
Enabled this new feature with the makefile variable GREP_LIBZ. If
you don't like it, compile with `make GREP_LIBZ='.

grep + zlib has several advantages:

- the shell script zgrep(1) will be basically a one line
  exec grep -Z "$@"

- no shell script, no bugs. The current zgrep implementations
  have many bugs and some grep options are no supported.

- no shell script, no security risks.

- it is a magnitude faster than a shell script

Also fixed:
0 -> STDIN_FILENO
Close a file descriptor only if the open call was successfully. It does
not hurt for the open(2) function, but the gzclose(3) function
died in free() to free up (not) allocated memory.
1997-12-20 18:46:09 +00:00
Andrey A. Chernov
62fe88f9af Add unsigned char cast to ctype macros 1997-10-23 02:08:16 +00:00
Andrey A. Chernov
8b50620f9a Add (unsigned char) casts to ctype macros 1997-10-23 01:43:00 +00:00
Mike Pritchard
6d9688a364 Fix a number of typos, one of which is part of PR# 2917. 1997-03-09 00:33:19 +00:00
Andrey A. Chernov
d635f7bb20 Replace collate_range_cmp call with its code (GNU version) 1996-10-31 07:45:15 +00:00
Wolfram Schneider
d7c71d3534 grep -q pattern file
search 'pattern' in whole file 'file', from top to bottom.  This is
not necessary; if grep found 'pattern' it can stop further searching
in file 'file'.

Example:

$ time ./grep-old -q Adam /usr/share/dict/*
        1.93 real         1.05 user         0.85 sys
$ time ./grep-new -q Adam /usr/share/dict/*
        0.14 real         0.06 user         0.06 sys
1996-09-27 19:44:46 +00:00
Wolfram Schneider
8a9374d25b test 37: [b-a] is a syntax error and exit with status 2 1996-09-27 19:40:39 +00:00
Andrey A. Chernov
5dc826672f Use collate for alpha character ranges 1996-08-13 14:21:48 +00:00
Andrey A. Chernov
83d7542f35 Pick collate info too 1996-08-12 17:55:41 +00:00
Wolfram Schneider
12e1f465dd recursive grep, enabled with -DHAVE_FTS=1
enable mmap (-DHAVE_MMAP=1)
1996-02-02 06:45:26 +00:00
Peter Wemm
6065a0be11 This commit was generated by cvs2svn to compensate for changes in r13122,
which included commits to RCS files with non-trunk default branches.
1995-12-30 19:02:48 +00:00
Peter Wemm
a5b996a7ec recording cvs-1.6 file death 1995-12-30 19:02:48 +00:00