NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
PR/53513 CVS commit: src/external/bsd/tre/dist/src
The following reply was made to PR bin/53513; it has been noted by GNATS.
From: "Andrius Varanavicius" <andvar%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc:
Subject: PR/53513 CVS commit: src/external/bsd/tre/dist/src
Date: Thu, 23 May 2024 22:07:16 +0000
Module Name: src
Committed By: andvar
Date: Thu May 23 22:07:16 UTC 2024
Modified Files:
src/external/bsd/tre/dist/src: agrep.c
Log Message:
agrep(1): rewrite binary check introduced with recursive search on rev 1.3 to
match more closely grep(1) implementation. Instead of opening and scanning
full file every time, check for the \0 symbol once the file buffer is filled up
for the first time.
Patch fixes stdin, adds binary check for it as well, and works more efficiently
(at the cost of not scanning the full file).
Also original implementation forgot to add break if binary file is detected,
causing duplicate binary matches in the output result.
Due to full file scans on each match instead of once for the specific file,
scans may have been considerably slow.
Fixes PR bin/53513
Needs pullups to netbsd-9,-10.
Thanks for the help from mlelstv and dh in reviewing and finalizing the patch.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/tre/dist/src/agrep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index