OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.17 / (download) - annotate - [select for diffs], Wed Dec 15 19:22:44 2021 UTC (2 years, 5 months ago) by tb
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, OPENBSD_7_1_BASE, OPENBSD_7_1, HEAD
Changes since 1.16: +3 -1 lines
Diff to previous 1.16 (colored)

grep: Add missing unistd.h and limits.h includes

Both binary.c and file.c currently pull in unistd.h via zlib's zconf.h.
binary.c uses SEEK_SET and file.c a bunch of things like close(), isatty(),
lseek(). In addition file.c needs limits.h for PATH_MAX.

ok deraadt

Revision 1.16 / (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_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

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

Revision 1.15 / (download) - annotate - [select for diffs], Thu Jan 31 01:30:46 2019 UTC (5 years, 3 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, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.14: +12 -8 lines
Diff to previous 1.14 (colored)

convert fgetln to getline. this improves portability and sets a good
better example for other code to follow. in the common case, grep uses
mmap anyway (so no functional change). despite fgetln doing sneaky things
with stdio internals, preliminary analysis by lauri suggests this may
actually reduce the number of allocations.
from Lauri Tirkkonen.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Jan 23 23:00:54 2019 UTC (5 years, 3 months ago) by tedu
Branch: MAIN
Changes since 1.13: +34 -35 lines
Diff to previous 1.13 (colored)

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

Revision 1.13 / (download) - annotate - [select for diffs], Mon Mar 16 13:27:59 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, 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, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.12: +1 -2 lines
Diff to previous 1.12 (colored)

Don't include limits.h or sys/limits.h since grep.h already does it
for us.

Revision 1.12 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:08 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.11: +3 -4 lines
Diff to previous 1.11 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.11 / (download) - annotate - [select for diffs], Fri Jul 2 20:48:48 2010 UTC (13 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.10: +9 -1 lines
Diff to previous 1.10 (colored)

Do not include mmap support with -DSMALL.

ok millert

Revision 1.10 / (download) - annotate - [select for diffs], Thu Oct 16 22:56:32 2008 UTC (15 years, 7 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
Changes since 1.9: +3 -1 lines
Diff to previous 1.9 (colored)

two globals not needed in NOZ mode

Revision 1.9 / (download) - annotate - [select for diffs], Thu Feb 9 09:54:46 2006 UTC (18 years, 3 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, 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.8: +1 -19 lines
Diff to previous 1.8 (colored)

delint; remove redundant vars and functions; ok jaredy@

Revision 1.8 / (download) - annotate - [select for diffs], Tue Feb 7 22:05:54 2006 UTC (18 years, 3 months ago) by otto
Branch: MAIN
Changes since 1.7: +2 -1 lines
Diff to previous 1.7 (colored)

restore cosmic balance by plugging a mem leak; problem reported by
Benjamin Pineau in PR 5008; ok weingart@

Revision 1.7 / (download) - annotate - [select for diffs], Mon Feb 7 08:47:18 2005 UTC (19 years, 3 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.6: +8 -1 lines
Diff to previous 1.6 (colored)

Due to a braindead zlib, the test for seekability of a gzstream using
gzseek(f, 0L, SEEK_CUR) does not work as expected. Instead test the
underlying stream and remember that. This repairs echo foo | gzip | zgrep foo.
Problem spotted by Han Boetes in PR 4089; ok millert@

Revision 1.6 / (download) - annotate - [select for diffs], Wed Feb 2 06:17:17 2005 UTC (19 years, 3 months ago) by tedu
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

replace 0 with STDIN_FILENO.  from han boetes and jared yanovich

Revision 1.5 / (download) - annotate - [select for diffs], Mon Dec 29 21:20:55 2003 UTC (20 years, 4 months ago) by canacar
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

fix zgrep failure when the uncompressed file begins with a newline
also, search from the beginning if a stream or compressed file is
identified as 'binary'.
ok millert@, reported by tedu@, tested by jose@

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jul 10 17:02:48 2003 UTC (20 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.3: +7 -7 lines
Diff to previous 1.3 (colored)

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

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: +29 -13 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.