summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* tests: Make the -files0-from tests weirderTavian Barnes2021-09-153-103/+65
|
* Implement -files0-from FILETavian Barnes2021-09-156-4/+240
| | | | | See https://savannah.gnu.org/bugs/?60383 for the development of the corresponding GNU find feature.
* util: Wrap getdelim() instead of open coding itTavian Barnes2021-09-152-27/+34
|
* spawn: Plug some leaks on error pathsTavian Barnes2021-09-151-0/+2
|
* eval: Remove an extra space from -ls outputTavian Barnes2021-09-021-1/+1
|
* eval: Use 512-byte blocks for -ls when POSIXLY_CORRECT is setTavian Barnes2021-09-024-4/+10
| | | | | This matches the behaviour of GNU find, and allows bfs to match the output of BSD find as well. Fixes #77.
* Use /usr/bin/env bash as the shebang in scriptsTavian Barnes2021-08-057-7/+7
| | | | This should reduce the need for patches on the BSDs.
* expr: Remove unneeded forward declaration of struct exprTavian Barnes2021-07-271-5/+3
|
* color: Fix a leak on unknown color keysTavian Barnes2021-06-161-2/+7
| | | | Previously reproducible with LS_COLORS="asdf=0" bfs.
* parse: More -help pager improvementsTavian Barnes2021-06-131-39/+24
| | | | | | | | | | 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.
* spawn: New function for resolving executables in the PATHTavian Barnes2021-06-132-17/+91
| | | | | This fixes the BFS_SPAWN_USEPATH to use the parent's environment, not the new child's environment, to resolve the executable.
* spawn: Allow NULL envp for the current environmentTavian Barnes2021-06-133-2/+8
|
* util: New xconfstr() wrapperTavian Barnes2021-06-132-0/+29
|
* util: Rename fallthrough to BFS_FALLTHROUGHTavian Barnes2021-06-094-15/+15
| | | | This avoids shadowing the actually standard name fallthrough.
* util: Avoid warnings on older compilers with fallthroughTavian Barnes2021-06-091-3/+9
|
* Release 2.2.12.2.1Tavian Barnes2021-06-023-2/+23
|
* Implement time units for -{a,B,c,m}timeTavian Barnes2021-06-025-14/+102
| | | | From FreeBSD find. Closes #75.
* Enable -Wimplicit-fallthroughTavian Barnes2021-06-024-7/+28
|
* eval: Raise RLIMIT_NOFILE if possibleTavian Barnes2021-05-204-11/+62
| | | | | | 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()).
* spawn: New bfs_spawn_addsetrlimit() actionTavian Barnes2021-05-202-0/+27
|
* Use `<< {10,20,...}` instead of `*1024*1024...`Tavian Barnes2021-05-202-6/+6
|
* tests: Don't use -perm /MODE in POSIX testsTavian Barnes2021-05-201-2/+2
|
* ci/freebsd: Use the official tailscale GitHub actionTavian Barnes2021-05-181-13/+4
|
* ci/freebsd: Use `tailscale ip` instead of hardcoding itTavian Barnes2021-05-181-3/+4
|
* ci/freebsd: Don't run multiple jobs at onceTavian Barnes2021-05-171-0/+2
|