summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2021-12-19ci/macos: Switch back to macos-latestTavian Barnes
2021-12-10ci/macos: Downgrade to macOS 10.15Tavian Barnes
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
2021-12-10tests: Set TZ to a real timezoneTavian Barnes
POSIX states that the offset is not optional in the TZ environment variable. Link: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html
2021-12-10stat: Work around GNU Hurd bugTavian Barnes
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
2021-12-05eval: Check that RLIM_SAVED_{CUR,MAX} are defined before using themTavian Barnes
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
2021-11-25ci/freebsd: Don't pin an old tailscale version2.3Tavian Barnes
2021-11-25Release 2.3Tavian Barnes
2021-11-23exec: Add a bit of backoff during ARG_MAX bisectionTavian Barnes
This reduces the number of E2BIGs we see if binary search reaches the top of the possible range.
2021-11-17exec: Find ARG_MAX with binary search after E2BIGTavian Barnes
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
2021-10-19parse: Switch back to O_TRUNC from explicit ftruncate()Tavian Barnes
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.
2021-10-19tests: Distinguish between failures and crashesTavian Barnes
2021-10-19tests: Set abort_on_error=1 for the sanitizersTavian Barnes
This makes it easier to distinguish crashes from expected failures
2021-10-19parse: Fix UAF + double-free when ftruncate() failsTavian Barnes
2021-10-09printf: Colorize file names/paths in simple casesTavian Barnes
2021-10-09color: New %pF format for file namesTavian Barnes
2021-10-09printf: Take a CFILE, not a FILETavian Barnes
2021-10-02ci/codecov: Disable status checksTavian Barnes
2021-10-01tests: Add a test for an operator in an unexpected positionTavian Barnes
2021-10-01tests: Add tests for parsing invalid integersTavian Barnes
And give some better error messages.
2021-10-01tests: Add a tests for missing and nonexistent pathsTavian Barnes
2021-09-28ci: Add a codecov.io workflowTavian Barnes
2021-09-26Don't truncate files until we know they're not duplicatesTavian Barnes
2021-09-21util: New xfopen() utilityTavian Barnes
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.
2021-09-21README: Fix a broken link to the NetBSD find manpageTavian Barnes
2021-09-21ctx: Also deduplicate the standard streamsTavian Barnes
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.
2021-09-20Merge pull request #80 from a1346054/fixesTavian Barnes
Remove completion hashbang
2021-09-20Trim excess whitespacea1346054
2021-09-20Avoid using a misleading hashbanga1346054
For consistency with other completion scripts and to silence warnings such as https://lintian.debian.org/tags/bash-completion-with-hashbang
2021-09-15Fix the order of -fprintf FILE FORMAT in the docsTavian Barnes
2021-09-15tests: Make the -files0-from tests weirderTavian Barnes
2021-09-15Implement -files0-from FILETavian Barnes
See https://savannah.gnu.org/bugs/?60383 for the development of the corresponding GNU find feature.
2021-09-15util: Wrap getdelim() instead of open coding itTavian Barnes
2021-09-15spawn: Plug some leaks on error pathsTavian Barnes
2021-09-02eval: Remove an extra space from -ls outputTavian Barnes
2021-09-02eval: Use 512-byte blocks for -ls when POSIXLY_CORRECT is setTavian Barnes
This matches the behaviour of GNU find, and allows bfs to match the output of BSD find as well. Fixes #77.
2021-08-05Use /usr/bin/env bash as the shebang in scriptsTavian Barnes
This should reduce the need for patches on the BSDs.
2021-07-27expr: Remove unneeded forward declaration of struct exprTavian Barnes
2021-06-16color: Fix a leak on unknown color keysTavian Barnes
Previously reproducible with LS_COLORS="asdf=0" bfs.
2021-06-13parse: More -help pager improvementsTavian Barnes
If $PAGER is unset, we now try less if it exists, then fall back to more. Colors are only used if less is the used pager, since more on non-coreutils platforms doesn't always handle colors. Finally, less's configuration is given on the command line, which works better if the user has $LESS already set. Fixes https://github.com/tavianator/bfs/issues/76.
2021-06-13spawn: New function for resolving executables in the PATHTavian Barnes
This fixes the BFS_SPAWN_USEPATH to use the parent's environment, not the new child's environment, to resolve the executable.
2021-06-13spawn: Allow NULL envp for the current environmentTavian Barnes
2021-06-13util: New xconfstr() wrapperTavian Barnes
2021-06-09util: Rename fallthrough to BFS_FALLTHROUGHTavian Barnes
This avoids shadowing the actually standard name fallthrough.
2021-06-09util: Avoid warnings on older compilers with fallthroughTavian Barnes
2021-06-02Release 2.2.12.2.1Tavian Barnes
2021-06-02Implement time units for -{a,B,c,m}timeTavian Barnes
From FreeBSD find. Closes #75.
2021-06-02Enable -Wimplicit-fallthroughTavian Barnes
2021-05-20eval: Raise RLIMIT_NOFILE if possibleTavian Barnes
This lets us keep more open FDs cached in bftw(). The limit is lowered before running -exec commands, in case they're incompatible with a high limit (e.g. due to select()).
2021-05-20spawn: New bfs_spawn_addsetrlimit() actionTavian Barnes
2021-05-20Use `<< {10,20,...}` instead of `*1024*1024...`Tavian Barnes