summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* tests: New test for -prune on a non-directoryTavian Barnes2022-02-012-0/+15
|
* tests: Try to color diff outputTavian Barnes2022-02-011-11/+18
|
* tests: set -P for the whole scriptTavian Barnes2022-02-011-2/+1
| | | | We rely on physical path resolution in test_execdir_pwd.
* tests: Allow tests.sh to be invoked from any directoryTavian Barnes2022-02-012-14/+22
| | | | | This also resolves the path passed to --bfs early, so --bfs=./bfs now works.
* parse: Add support for ed and sed regexesTavian Barnes2022-01-304-1/+20
| | | | They're apparently the same as POSIX basic regexes.
* Revert "tests: Add a test for posix-basic alternation"Tavian Barnes2022-01-292-7/+0
| | | | | | | Turns out alternation is not actually part of the POSIX basic regular expression language, it's just a glibc extension. This reverts commit c898af13a671ee92a056467d324f16823594eb1c.
* tests: Add a test for posix-basic alternationTavian Barnes2022-01-292-0/+7
|
* Standardize WITH_* make variables for configuring dependenciesTavian Barnes2022-01-297-32/+54
|
* Merge pull request #81 from data-man:oniguruma_1Tavian Barnes2022-01-297-6/+37
|\
| * Apply suggestions from code reviewdata-man2022-01-242-12/+8
| |
| * Simplifyingdata-man2022-01-246-31/+31
| |
| * Using Oniguruma library (optionally)data-man2022-01-246-5/+40
|/
* Release 2.3.12.3.1Tavian Barnes2022-01-213-2/+16
|
* bftw: Use a dynamic array for the cacheTavian Barnes2022-01-181-45/+42
| | | | | | | Since commit 69a5227 ("eval: Raise RLIMIT_NOFILE if possible"), bfs can pass a large nopenfd (e.g. 512K) to bftw() by default. This resulted in a large up-front allocation even for small trees. Change it to grow on demand, lowering the footprint for small searches.
* darray: New DARRAY_POP() macroTavian Barnes2022-01-182-2/+34
|
* dstring: Set a minimum capacity to avoid reallocating for small stringsTavian Barnes2022-01-181-1/+6
|
* tests: Add missing license headersTavian Barnes2022-01-182-0/+32
|
* tests/trie: Fix "handling" typoTavian Barnes2022-01-181-1/+1
|
* util: New close() wrappers to check for EBADF and preserve errnoTavian Barnes2022-01-189-53/+66
|
* dir: Fix extra close() if fdopendir() failsTavian Barnes2022-01-181-2/+4
|
* Add some missing (void)'sTavian Barnes2022-01-182-2/+2
|
* ci/macos: Switch back to macos-latestTavian Barnes2021-12-192-24/+34
|
* ci/macos: Downgrade to macOS 10.15Tavian Barnes2021-12-101-1/+2
| | | | | | | macOS 11 comes with a broken touch(1) that ignores -h. Work around it for now by downgrading macOS. Link: https://apple.stackexchange.com/a/425730/397839
* tests: Set TZ to a real timezoneTavian Barnes2021-12-101-1/+1
| | | | | | | POSIX states that the offset is not optional in the TZ environment variable. Link: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html
* stat: Work around GNU Hurd bugTavian Barnes2021-12-101-1/+2
| | | | | | | fstatat(fd, "", buf, AT_EMPTY_PATH) fails with a nonsense errno on Hurd. Since fstat() itself works fine, just use that. Link: https://lists.gnu.org/archive/html/bug-hurd/2021-12/msg00001.html
* eval: Check that RLIM_SAVED_{CUR,MAX} are defined before using themTavian Barnes2021-12-051-3/+24
| | | | | Apparently they're missing on Debian kfreebsd: https://buildd.debian.org/status/fetch.php?pkg=bfs&arch=kfreebsd-amd64&ver=2.3-1&stamp=1638379495&raw=0
* ci/freebsd: Don't pin an old tailscale version2.3Tavian Barnes2021-11-251-1/+0
|
* Release 2.3Tavian Barnes2021-11-254-3/+25
|
* exec: Add a bit of backoff during ARG_MAX bisectionTavian Barnes2021-11-231-7/+11
| | | | | This reduces the number of E2BIGs we see if binary search reaches the top of the possible range.
* exec: Find ARG_MAX with binary search after E2BIGTavian Barnes2021-11-172-14/+67
| | | | | | | | | | | | | | | | | | | | | Previously we would shrink the command by one argument at a time until a successful execution. This is okay if the ARG_MAX estimate is just a little bit off, but is terribly slow when it's off by a lot. One situation where it's very far off is when a 32-bit build of bfs launches a 64-bit binary. In this case, bfs thinks the argv pointers are 4 bytes, while they actually take up 8 bytes. The performance is quite bad: $ time ./bfs-64 ~/code/linux -exec echo {} + >/dev/null ./bfs-64 ~/code/linux -exec echo {} + > /dev/null 0.03s user 0.07s system 99% cpu 0.095 total $ time ./bfs-32 ~/code/linux -exec echo {} + >/dev/null ./bfs-32 ~/code/linux -exec echo {} + > /dev/null 0.08s user 10.33s system 100% cpu 10.390 total After this change, performance is much better: $ time ./bfs-32 ~/code/linux -exec echo {} + >/dev/null ./bfs-32 ~/code/linux -exec echo {} + > /dev/null 0.03s user 0.08s system 99% cpu 0.110 total
* parse: Switch back to O_TRUNC from explicit ftruncate()Tavian Barnes2021-10-192-31/+16
| | | | | | | | O_TRUNC is not equivalent to an unconditional ftruncate(), e.g. for device files. This reverts the behaviour change from 78944c81, which was never released and is not supported in other find implementations.
* tests: Distinguish between failures and crashesTavian Barnes2021-10-191-47/+61
|
* tests: Set abort_on_error=1 for the sanitizersTavian Barnes2021-10-191-0/+6
| | | | This makes it easier to distinguish crashes from expected failures
* parse: Fix UAF + double-free when ftruncate() failsTavian Barnes2021-10-191-5/+8
|
* printf: Colorize file names/paths in simple casesTavian Barnes2021-10-093-8/+76
|
* color: New %pF format for file namesTavian Barnes2021-10-092-5/+36
|
* printf: Take a CFILE, not a FILETavian Barnes2021-10-093-65/+66
|
* ci/codecov: Disable status checksTavian Barnes2021-10-021-0/+4
|
* tests: Add a test for an operator in an unexpected positionTavian Barnes2021-10-011-0/+5
|
* tests: Add tests for parsing invalid integersTavian Barnes2021-10-012-4/+41
| | | | And give some better error messages.
* tests: Add a tests for missing and nonexistent pathsTavian Barnes2021-10-011-0/+20
|
* ci: Add a codecov.io workflowTavian Barnes2021-09-281-0/+31
|
* Don't truncate files until we know they're not duplicatesTavian Barnes2021-09-268-68/+115
|
* util: New xfopen() utilityTavian Barnes2021-09-215-3/+58
| | | | | And use it to pass O_CLOEXEC to all FILE*'s, so the files opened for -fprint etc. don't get passed to the programs run by -exec etc.
* README: Fix a broken link to the NetBSD find manpageTavian Barnes2021-09-211-1/+1
|
* ctx: Also deduplicate the standard streamsTavian Barnes2021-09-216-41/+177
| | | | | | This fixes some potential missing output when the same file is used in a redirection and something like -fprint. The main benefit is smarter handling of /dev/stdout, which will now share the CFILE* with cout.
* Merge pull request #80 from a1346054/fixesTavian Barnes2021-09-201-4/+2
|\ | | | | Remove completion hashbang
| * Trim excess whitespacea13460542021-09-201-1/+1
| |
| * Avoid using a misleading hashbanga13460542021-09-201-3/+1
|/ | | | | For consistency with other completion scripts and to silence warnings such as https://lintian.debian.org/tags/bash-completion-with-hashbang
* Fix the order of -fprintf FILE FORMAT in the docsTavian Barnes2021-09-152-2/+2
|