OpenBSD CVS

CVS log for src/usr.bin/grep/grep.h


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.29 / (download) - annotate - [select for diffs], Sun Jun 26 10:57:36 2022 UTC (22 months, 3 weeks ago) by op
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, HEAD
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (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.28 / (download) - annotate - [select for diffs], Wed Mar 10 21:55:22 2021 UTC (3 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

zlib functions take a gzFile not gzFile * (gzFile is already a pointer).
From Josh Rickmar.

Revision 1.27 / (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_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.26: +2 -1 lines
Diff to previous 1.26 (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.26 / (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.25: +5 -4 lines
Diff to previous 1.25 (colored)

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

Revision 1.25 / (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.24: +6 -3 lines
Diff to previous 1.24 (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.24 / (download) - annotate - [select for diffs], Mon Dec 14 20:02:07 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

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

ok kettenis@

Revision 1.23 / (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.22: +2 -2 lines
Diff to previous 1.22 (colored)

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

Revision 1.22 / (download) - annotate - [select for diffs], Mon Mar 16 13:26:52 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.21: +3 -2 lines
Diff to previous 1.21 (colored)

Include limits.h, not sys/limits.h and include stdint.h for SIZE_MAX.

Revision 1.21 / (download) - annotate - [select for diffs], Sat Jan 10 13:48:02 2015 UTC (9 years, 4 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

1. They're flags, not counters. Set to one instead of incrementing.
2. The G flag is useless and never checked. Remove it.
ok millert

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

use reallocarray()

Revision 1.19 / (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_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

unsigned char casts for ctype
ok krw

Revision 1.18 / (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_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

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

Revision 1.17 / (download) - annotate - [select for diffs], Fri Jul 8 01:20:24 2011 UTC (12 years, 10 months ago) by tedu
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.16: +3 -3 lines
Diff to previous 1.16 (colored)

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

Revision 1.16 / (download) - annotate - [select for diffs], Fri Mar 4 03:11:23 2011 UTC (13 years, 2 months ago) by tedu
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

add -H (opposite of -h) to always print name. ok deraadt millert

Revision 1.15 / (download) - annotate - [select for diffs], Mon Apr 5 03:03:55 2010 UTC (14 years, 1 month ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (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.14 / (download) - annotate - [select for diffs], Sun Sep 2 15:19:32 2007 UTC (16 years, 8 months ago) by deraadt
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.13: +2 -1 lines
Diff to previous 1.13 (colored)

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

Revision 1.13 / (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_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.12: +3 -7 lines
Diff to previous 1.12 (colored)

delint; remove redundant vars and functions; ok jaredy@

Revision 1.12 / (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_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.11: +2 -3 lines
Diff to previous 1.11 (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.11 / (download) - annotate - [select for diffs], Fri May 7 14:51:42 2004 UTC (20 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.10: +2 -1 lines
Diff to previous 1.10 (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.10 / (download) - annotate - [select for diffs], Sun Jan 25 21:36:00 2004 UTC (20 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (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.9 / (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.8: +2 -2 lines
Diff to previous 1.8 (colored)

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

ok millert@

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jul 2 21:04:10 2003 UTC (20 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.7: +2 -1 lines
Diff to previous 1.7 (colored)

protos

Revision 1.7 / (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.6: +3 -2 lines
Diff to previous 1.6 (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.6 / (download) - annotate - [select for diffs], Wed Jun 25 15:02:36 2003 UTC (20 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.5: +4 -4 lines
Diff to previous 1.5 (colored)

Function prototypes that take no args should have (void) as the parameter.

Revision 1.5 / (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.4: +3 -2 lines
Diff to previous 1.4 (colored)

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

Revision 1.4 / (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.3: +17 -3 lines
Diff to previous 1.3 (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.3 / (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.2: +7 -2 lines
Diff to previous 1.2 (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.2 / (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.1: +2 -0 lines
Diff to previous 1.1 (colored)

proper $OpenBSD$

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.