Commit Graph

33 Commits

Author SHA1 Message Date
Jung-uk Kim
4a4051fe5e Remove redundant string length check from the previous commit. 2005-10-21 15:17:18 +00:00
Jung-uk Kim
354cdde5b9 Fix a longstanding buglet in bz-prefixed grep(1). 2005-10-20 21:50:44 +00:00
Tim J. Robbins
712fe40aed Removed redundant (and incorrect) code in prline. Fixes grep -i --color "",
among other things.

PR:		79063
Obtained from:	Fedora (Tim Waugh)
2005-05-14 05:35:04 +00:00
Tim J. Robbins
833d4d167b Fix background colour problems with --color output (RH bug #138913).
Obtained from:	Karsten Hopp via Fedora
2005-05-14 05:26:48 +00:00
Tim J. Robbins
52e523ead7 Remove mb-caching hack.
Obtained from:	Fedora (Tim Waugh)
2005-05-14 03:02:22 +00:00
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
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
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
e5978bf334 Merge local changes. 2004-07-04 10:02:03 +00:00
Andrey A. Chernov
0416b7503d Merge conflicts, upgrade 2004-03-01 08:37:20 +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
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
1331c61815 Fix conflicts. 2000-01-18 09:46:39 +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
7e5b33c6cd Merge FreeBSD chagnes into GNU grep 2.4. 2000-01-04 03:25:40 +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
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
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
Bruce Evans
2512f2fe3b Fixed printf format errors. 1998-06-30 20:14:13 +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
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
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
Andrey A. Chernov
9203a11a55 Add setlocale LC_CTYPE
Fix icase searches for 8bit charsets
1995-10-28 19:16:14 +00:00
Rodney W. Grimes
4399be3cbd Remove trailing whitespace. 1995-05-30 05:05:38 +00:00
Nate Williams
c0db29cc59 Update GNU grep to version 2.0 1993-07-06 18:45:26 +00:00
Nate Williams
717f769197 Gnu e?grep 1.6 1993-06-29 06:04:45 +00:00