OpenBSD CVS

CVS log for src/usr.bin/grep/util.c


[BACK] Up to [local] / src / usr.bin / grep

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.68 / (download) - annotate - [select for diffs], Wed Nov 15 00:50:43 2023 UTC (6 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.67: +7 -4 lines
Diff to previous 1.67 (colored)

procline: only reduce mcount once per line, not once per match.
This makes "grep -m" behave like GNU grep (where the -m option
originated).  From Crystal Kolipe.

Revision 1.67 / (download) - annotate - [select for diffs], Tue Jul 12 18:09:31 2022 UTC (22 months, 1 week ago) by op
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.66: +7 -9 lines
Diff to previous 1.66 (colored)

grep: simplify printline, no functional changes

in the previous revision (1.66) I added an extra variable to track
wether we have printed the separator or not.  Well, that's what the `n'
variable is for, so no need to duplicate the logic.

Revision 1.66 / (download) - annotate - [select for diffs], Sun Jun 26 10:57:36 2022 UTC (22 months, 3 weeks ago) by op
Branch: MAIN
Changes since 1.65: +13 -8 lines
Diff to previous 1.65 (colored)

grep: add --null flag

makes grep print an ASCII NUL byte after the file name to make the
output unambiguous even in the presence of file names with funny
characters.

A previous iteration of this diff was improved by benno@ and tedu@ and
discussed also with sthen@ and deraadt@.  deraadt@ also improved the
manpage changes in this version of the diff.

OK deraadt@

Revision 1.65 / (download) - annotate - [select for diffs], Mon May 30 16:07:28 2022 UTC (23 months, 2 weeks ago) by dv
Branch: MAIN
Changes since 1.64: +4 -2 lines
Diff to previous 1.64 (colored)

grep(1): print full context when using match count

When using the match count flag (-m), grep was not printing the
context after the match if the -A or -C flags were provided.

This changes the logic to continue printing lines after hitting the
match count.

ok op@, millert@

Revision 1.64 / (download) - annotate - [select for diffs], Tue Dec 28 16:27:53 2021 UTC (2 years, 4 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.63: +3 -3 lines
Diff to previous 1.63 (colored)

Fix printing of -- marker when using -A as noted by gnezdo@
ok millert@

Revision 1.63 / (download) - annotate - [select for diffs], Thu Jul 23 20:19:27 2020 UTC (3 years, 9 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.62: +10 -6 lines
Diff to previous 1.62 (colored)

Change line counter from int to unsigned long long to reduce overflow.
In case unsigned long long is miraculously still too small add an
additional overflow detection so we stop counting and add a marker to
couter output.

Input on earlier diff guenther@
OK millert

Revision 1.62 / (download) - annotate - [select for diffs], Tue Dec 3 09:14:37 2019 UTC (4 years, 5 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.61: +12 -2 lines
Diff to previous 1.61 (colored)

With -R and an implicit ".", don't prepend file paths with "./"

Looks nicer and matches the output of GNU grep.
ok millert@ deraadt@ visa@ miod@

Revision 1.61 / (download) - annotate - [select for diffs], Mon Oct 7 17:47:32 2019 UTC (4 years, 7 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.60: +3 -1 lines
Diff to previous 1.60 (colored)

two compat features to allow the zstdgrep script to work.
add --label option to prefix the output instead of filename.
allow using - to mean stdin.
ok deraadt

Revision 1.60 / (download) - annotate - [select for diffs], Wed Jul 17 04:24:20 2019 UTC (4 years, 10 months ago) by tedu
Branch: MAIN
Changes since 1.59: +3 -2 lines
Diff to previous 1.59 (colored)

when combining -o and -b, print the byte offset of the pattern, not line.
originally from chrisz

Revision 1.59 / (download) - annotate - [select for diffs], Wed Jan 23 23:00:54 2019 UTC (5 years, 3 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.58: +6 -3 lines
Diff to previous 1.58 (colored)

rework grep_open to be more careful about directories.
cleaner, but should be no functional change.
from Lauri Tirkkonen

Revision 1.58 / (download) - annotate - [select for diffs], Sat Dec 9 18:38:37 2017 UTC (6 years, 5 months ago) by pirofti
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.57: +11 -1 lines
Diff to previous 1.57 (colored)

Add support for the non-standard grep -m extension.

grep -m num stops after a maximum of num matches are found.
We support -m0 to match GNU behaviour, but we do not allow negative
numbers.

Manpage help from jmc@, OK deraadt@.

Revision 1.57 / (download) - annotate - [select for diffs], Mon Apr 3 16:18:35 2017 UTC (7 years, 1 month ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.56: +2 -2 lines
Diff to previous 1.56 (colored)

initialize regmatch_t always, fixes grep -o ""
from Michael Santos

Revision 1.56 / (download) - annotate - [select for diffs], Thu Aug 25 15:11:05 2016 UTC (7 years, 8 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.55: +14 -5 lines
Diff to previous 1.55 (colored)

when using -o, we may restart a match in the middle of the line.
set NOTBOL so that anchored patterns don't match.
from a patch by Daniƫl de Kok in freebsd bug 201650
ok martijn

Revision 1.55 / (download) - annotate - [select for diffs], Mon Apr 4 05:49:47 2016 UTC (8 years, 1 month ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.54: +2 -2 lines
Diff to previous 1.54 (colored)

Reverse search optimization makes no sense (and doesn't work) if
we are looking for all matches in a line; ok natano@ miilert@ tedu@

Revision 1.54 / (download) - annotate - [select for diffs], Tue Dec 22 19:35:50 2015 UTC (8 years, 4 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored)

cast toupper's argument to unsigned char

ok millert@

Revision 1.53 / (download) - annotate - [select for diffs], Tue Dec 22 17:07:06 2015 UTC (8 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.52: +11 -11 lines
Diff to previous 1.52 (colored)

The loop index in grep_cmp() should be size_t to match the type of
the length parameter.  The return value of grep_cmp() is only used
in a boolean context so make it return bool instead of the index.
OK mmcc@

Revision 1.52 / (download) - annotate - [select for diffs], Mon Dec 14 20:02:07 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

Use long long rather than off_t for line_no to ensure that it's always
64 bits.

ok kettenis@

Revision 1.51 / (download) - annotate - [select for diffs], Mon Dec 7 18:50:06 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (colored)

Represent line numbers with off_t rather than int. This prevents
overflow on huge inputs. ok millert@, deraadt@

Revision 1.50 / (download) - annotate - [select for diffs], Thu Jun 25 02:04:08 2015 UTC (8 years, 10 months ago) by uebayasi
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

Put fts_close() where missing.

Not bugs in short-lived commands that call exit() -> _exit() immediately,
but for idempotency.

Originally found in ls(1) by Valgrind.  Changes for other commands are
from deraadt@.  Reviewed by me, tested in snapshots.

OK deraadt@

Revision 1.49 / (download) - annotate - [select for diffs], Mon Dec 1 06:36:04 2014 UTC (9 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.48: +9 -1 lines
Diff to previous 1.48 (colored)

use reallocarray()

Revision 1.48 / (download) - annotate - [select for diffs], Tue May 20 01:25:23 2014 UTC (10 years ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

Use errc/warnc to simplify code.
Also, in 'ftp', always put the error message last, after the hostname/ipaddr.

ok jsing@ krw@ millert@

Revision 1.47 / (download) - annotate - [select for diffs], Tue Nov 26 13:21:16 2013 UTC (10 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored)

unsigned char casts for ctype
ok krw

Revision 1.46 / (download) - annotate - [select for diffs], Sat May 4 00:26:20 2013 UTC (11 years ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.45: +21 -11 lines
Diff to previous 1.45 (colored)

blacklist a select few characters instead of a limited whitelist for
detecting non-regex patterns. makes the fast grep code more applicable.
with some improvements by Jeremie Courreges-Anglas

Revision 1.45 / (download) - annotate - [select for diffs], Sat Dec 29 01:32:44 2012 UTC (11 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.44: +5 -2 lines
Diff to previous 1.44 (colored)

Fix exit status when there is an error reading a file.
Reported by Jeramey Crawford, fix adapted from FreeBSD.
OK guenther@

Revision 1.44 / (download) - annotate - [select for diffs], Wed Dec 12 11:12:24 2012 UTC (11 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

Don't print zero length matches in -o mode.  Found by otto@ who
initially proposed a different fix.  OK otto@

Revision 1.43 / (download) - annotate - [select for diffs], Tue Dec 11 16:40:01 2012 UTC (11 years, 5 months ago) by otto
Branch: MAIN
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

use proper eol offset for -o matching; spotted by ajacoutot@; ok millert@

Revision 1.42 / (download) - annotate - [select for diffs], Sun Jul 17 19:39:21 2011 UTC (12 years, 10 months ago) by aschrijver
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.41: +9 -3 lines
Diff to previous 1.41 (colored)

Fix an integer overflow for very long lines by replacing the datatype of 2 offsets from int to regoff_t.

Bail if the given size_t line length doesn't fit into the new regoff_t.

"I don't think you will ever be able to get a string longer than
SSIZE_MAX into memory, but that looks good." tedu@

"Agreed" otto@

regoff_t suggested by otto@

Revision 1.41 / (download) - annotate - [select for diffs], Mon Jul 11 20:43:21 2011 UTC (12 years, 10 months ago) by tedu
Branch: MAIN
Changes since 1.40: +2 -1 lines
Diff to previous 1.40 (colored)

the matchall magic shortcut requires we set c=1 to print now
fixes libpqxx build

Revision 1.40 / (download) - annotate - [select for diffs], Fri Jul 8 01:20:24 2011 UTC (12 years, 10 months ago) by tedu
Branch: MAIN
Changes since 1.39: +37 -19 lines
Diff to previous 1.39 (colored)

add support for -o to only print the match.
reminded this was useful by ajcoutot

Revision 1.39 / (download) - annotate - [select for diffs], Fri Jul 2 22:18:03 2010 UTC (13 years, 10 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.38: +15 -1 lines
Diff to previous 1.38 (colored)

Remove the "fast" grep code if SMALL.  This has the side effect of breaking
fgrep -w, but oh well.  ok deraadt millert

Revision 1.38 / (download) - annotate - [select for diffs], Sun Apr 25 14:13:36 2010 UTC (14 years ago) by eric
Branch: MAIN
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored)

prevent out-of-bounds access with empty pattern (fixes  "grep -x ''")

ok millert@ krw@

Revision 1.37 / (download) - annotate - [select for diffs], Mon Apr 5 03:03:55 2010 UTC (14 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.36: +3 -10 lines
Diff to previous 1.36 (colored)

remove some non-POSIX standard non-GNU defacto standard options, mostly
relating to symlinks that you can get with find.  And a bonus fts flag fix.
With a small tweak by guenther.  ok deraadt guenther jmc millert nicm

Revision 1.36 / (download) - annotate - [select for diffs], Tue Oct 2 17:59:18 2007 UTC (16 years, 7 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.35: +1 -2 lines
Diff to previous 1.35 (colored)

Process patterns containing $ end ^ (but not as last or first char)
using regcomp() instead of fastcomp(). ok millert@

Revision 1.35 / (download) - annotate - [select for diffs], Sun Sep 2 15:19:32 2007 UTC (16 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.34: +11 -1 lines
Diff to previous 1.34 (colored)

use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg

Revision 1.34 / (download) - annotate - [select for diffs], Tue Dec 26 20:59:23 2006 UTC (17 years, 4 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.33: +3 -1 lines
Diff to previous 1.33 (colored)

fts_read returning NULL and errno set is an error. ok ray@

Revision 1.33 / (download) - annotate - [select for diffs], Fri Nov 17 02:01:29 2006 UTC (17 years, 6 months ago) by jaredy
Branch: MAIN
Changes since 1.32: +2 -1 lines
Diff to previous 1.32 (colored)

Reset the number of lines of tail context left to print
before processing each file to avoid printing lines
intended from the previous file.

Reported and fix by Charles Longeau <chl@tuxfamily.org>
via tech@.

ok otto millert

Revision 1.32 / (download) - annotate - [select for diffs], Tue Sep 26 15:55:17 2006 UTC (17 years, 7 months ago) by jaredy
Branch: MAIN
Changes since 1.31: +4 -3 lines
Diff to previous 1.31 (colored)

Allow zero-length patterns with -x so

  $ grep -x ""

matches empty lines as reported on misc@ by
Martin Marusak <marusak@fhpv.unipo.sk>.
Initial diff by otto@ with tweaks by me.

ok otto

Revision 1.31 / (download) - annotate - [select for diffs], Thu Feb 9 09:54:47 2006 UTC (18 years, 3 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.30: +2 -7 lines
Diff to previous 1.30 (colored)

delint; remove redundant vars and functions; ok jaredy@

Revision 1.30 / (download) - annotate - [select for diffs], Sun Apr 3 19:12:40 2005 UTC (19 years, 1 month ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.29: +7 -2 lines
Diff to previous 1.29 (colored)

Protect begin and end of word markers added to the pattern when
using the -w option with parentheses, to avoid operators in the
expressions binding to the markers. Compare [[:<:]]foo|bar[[:>:]]
and [[:<:]](foo|bar)[[:>:]]. Problem spotted by aaron@; ok millert@
aaron@ jaredy@

Revision 1.29 / (download) - annotate - [select for diffs], Sun Oct 3 19:23:02 2004 UTC (19 years, 7 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.28: +1 -3 lines
Diff to previous 1.28 (colored)

Remove block based mmap optimization. There are newline problems
(PR 3940, 3941) which can be fixed, but if a match starts at the
end of a block and continues into the next block, no match will be
found.  Measurements by millert@ showed that the improvements of
this optimization are non-measurable anyway. Diff from Alexander Taler.

ok millert@

Revision 1.28 / (download) - annotate - [select for diffs], Thu Sep 16 00:20:32 2004 UTC (19 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.27: +3 -4 lines
Diff to previous 1.27 (colored)

unused variables; otto ok

Revision 1.27 / (download) - annotate - [select for diffs], Wed Aug 11 13:18:58 2004 UTC (19 years, 9 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

Stop search when -q option is given and a match is found. Found by jmc@
ok millert@

Revision 1.26 / (download) - annotate - [select for diffs], Fri May 7 19:06:59 2004 UTC (20 years ago) by otto
Branch: MAIN
Changes since 1.25: +10 -2 lines
Diff to previous 1.25 (colored)

Make grep -w behave the same for the fastcomp and the regex case,
by teaching fastcomp what word boundaries are according to regex.

ok millert@

Revision 1.25 / (download) - annotate - [select for diffs], Fri May 7 14:51:42 2004 UTC (20 years ago) by millert
Branch: MAIN
Changes since 1.24: +47 -8 lines
Diff to previous 1.24 (colored)

Add a new past path for fgrep that is just a simplified version of
fastcomp.  This makes fgrep faster and fixes the -w flag w/ fgrep.
Also remove free_patterns() since calling free right before exit
is silly.  Problem noticed by espie@

Revision 1.24 / (download) - annotate - [select for diffs], Wed Feb 4 18:38:52 2004 UTC (20 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored)

Fix anchors (^ or $) in -w mode broken by the last commit's -w overhaul.
With this change we pass the updated regress.  Tested and OK by ho@

Revision 1.23 / (download) - annotate - [select for diffs], Mon Jan 26 14:50:29 2004 UTC (20 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

dataLen should be size_t to match l->len; ok otto@ tedu@

Revision 1.22 / (download) - annotate - [select for diffs], Sun Jan 25 21:36:00 2004 UTC (20 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.21: +42 -36 lines
Diff to previous 1.21 (colored)

Previously, in -w mode, for each match on a line grep would check
to see if the match was on a word boundary.  However, this missed
lines where the first match was not on a word boundary but a
subsequent match was.  Problem originally spotted by miod@

We fix this by using the [[:<:]] and [[:>:]] character classes for
the slow path and by checking the word boundaries in grep_search()
for the fast path instead of doing the checks after running
regexec() or grep_search().

With this change, grep passes the new regress tests 15 and 16.
problem originally spotted by espie@.

Revision 1.21 / (download) - annotate - [select for diffs], Mon Jan 19 16:12:04 2004 UTC (20 years, 4 months ago) by otto
Branch: MAIN
Changes since 1.20: +3 -2 lines
Diff to previous 1.20 (colored)

Use off_t for file sizes, and don't forget to print a ':' when using
the -b option.

ok millert@

Revision 1.20 / (download) - annotate - [select for diffs], Sun Jan 18 19:01:55 2004 UTC (20 years, 4 months ago) by espie
Branch: MAIN
Changes since 1.19: +2 -1 lines
Diff to previous 1.19 (colored)

make sure ln.len gets initialized. Okay millert@

Revision 1.19 / (download) - annotate - [select for diffs], Sat Dec 6 20:14:40 2003 UTC (20 years, 5 months ago) by otto
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

Unbreak grepping for some patterns containing multiple dots. Fixes PR 3597.

ok deraadt@ millert@

Revision 1.18 / (download) - annotate - [select for diffs], Tue Oct 28 13:23:59 2003 UTC (20 years, 6 months ago) by avsm
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

prototype declared static, but function was not. add static to function.
millert@ otto@ ok

Revision 1.17 / (download) - annotate - [select for diffs], Sun Jul 20 22:16:52 2003 UTC (20 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.16: +8 -4 lines
Diff to previous 1.16 (colored)

After some discussion on icb it seems a do {} while is what we want
after all since there's no need to check an invariant the first
time through.  I've fixed the loop invariants (we need to take
special care with the "j == fg->patternLen" case) and hopefully
made things a tad bit clearer.  tedu@ OK

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jul 20 19:19:48 2003 UTC (20 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.15: +4 -9 lines
Diff to previous 1.15 (colored)

Close PR 3358 by changing the loop from do {} while -> for;  tdeval@ OK

Revision 1.15 / (download) - annotate - [select for diffs], Thu Jul 10 19:16:22 2003 UTC (20 years, 10 months ago) by dhartmei
Branch: MAIN
Changes since 1.14: +5 -6 lines
Diff to previous 1.14 (colored)

restore grep -v semantics, print lines that don't match any (mismatch all)
patterns. ok tedu@, millert@

Revision 1.14 / (download) - annotate - [select for diffs], Thu Jul 10 17:02:48 2003 UTC (20 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.13: +6 -6 lines
Diff to previous 1.13 (colored)

grep should exit(2) on error, not exit(1) (1 means no matches found).
deraadt@ OK

Revision 1.13 / (download) - annotate - [select for diffs], Sun Jul 6 19:16:45 2003 UTC (20 years, 10 months ago) by avsm
Branch: MAIN
Changes since 1.12: +1 -27 lines
Diff to previous 1.12 (colored)

no need to redefine strlcpy here; millert@ ok

Revision 1.12 / (download) - annotate - [select for diffs], Tue Jul 1 00:09:23 2003 UTC (20 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.11: +3 -4 lines
Diff to previous 1.11 (colored)

Fix bounds check in the fast grep code that caused an incorrect
array access (and a core dump on sparc64 at least).  Noticed by
sturm@ and pvalchev@.  Fix tested an OK by pvalchev@.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jun 25 17:28:00 2003 UTC (20 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

o remove useless cast to int from gzread() call
o maxPatternLen should be size_t since that's what it is compared against
o remove useless casts of NULL to various pointer types

Revision 1.10 / (download) - annotate - [select for diffs], Wed Jun 25 05:31:11 2003 UTC (20 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.9: +7 -8 lines
Diff to previous 1.9 (colored)

knf

Revision 1.9 / (download) - annotate - [select for diffs], Tue Jun 24 22:36:40 2003 UTC (20 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.8: +20 -10 lines
Diff to previous 1.8 (colored)

Make 'grep -w' work; OK tedu@

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jun 24 18:45:30 2003 UTC (20 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.7: +8 -3 lines
Diff to previous 1.7 (colored)

actually do fgrep.  -G -F and -E are now mutally exclusive, and override
the program name as expected.  ok millert@

Revision 1.7 / (download) - annotate - [select for diffs], Tue Jun 24 17:32:10 2003 UTC (20 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.6: +28 -2 lines
Diff to previous 1.6 (colored)

don't print "Binary file matches" with -q flag.  from Sean Farley

Revision 1.6 / (download) - annotate - [select for diffs], Mon Jun 23 22:05:23 2003 UTC (20 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.5: +248 -2 lines
Diff to previous 1.5 (colored)

faster grep for simple patterns.  derived from a patch by sean farley.
this makes searching for constant strings much faster by avoiding regex.
ok deraadt@

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jun 23 07:52:18 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.4: +8 -5 lines
Diff to previous 1.4 (colored)

minor tweaks

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jun 23 00:55:09 2003 UTC (20 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.3: +15 -6 lines
Diff to previous 1.3 (colored)

better detetection/handling of binary files.
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@

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jun 22 22:38:50 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

proper $OpenBSD$

Revision 1.2 / (download) - annotate - [select for diffs], Sun Jun 22 22:24:13 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +5 -5 lines
Diff to previous 1.1 (colored)

-DNOZ flag to be used by install media for removing z*grep support, if
needed.  (and knf)

Revision 1.1 / (download) - annotate - [select for diffs], Sun Jun 22 22:20:07 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN

freegrep 0.16

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.