Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/external/bsd/tre/dist/src



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