Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | darray: New DARRAY_POP() macro | Tavian Barnes | 2022-01-18 | 2 | -2/+34 | |
| | ||||||
* | dstring: Set a minimum capacity to avoid reallocating for small strings | Tavian Barnes | 2022-01-18 | 1 | -1/+6 | |
| | ||||||
* | tests: Add missing license headers | Tavian Barnes | 2022-01-18 | 2 | -0/+32 | |
| | ||||||
* | tests/trie: Fix "handling" typo | Tavian Barnes | 2022-01-18 | 1 | -1/+1 | |
| | ||||||
* | util: New close() wrappers to check for EBADF and preserve errno | Tavian Barnes | 2022-01-18 | 9 | -53/+66 | |
| | ||||||
* | dir: Fix extra close() if fdopendir() fails | Tavian Barnes | 2022-01-18 | 1 | -2/+4 | |
| | ||||||
* | Add some missing (void)'s | Tavian Barnes | 2022-01-18 | 2 | -2/+2 | |
| | ||||||
* | ci/macos: Switch back to macos-latest | Tavian Barnes | 2021-12-19 | 2 | -24/+34 | |
| | ||||||
* | ci/macos: Downgrade to macOS 10.15 | Tavian Barnes | 2021-12-10 | 1 | -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 timezone | Tavian Barnes | 2021-12-10 | 1 | -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 bug | Tavian Barnes | 2021-12-10 | 1 | -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 them | Tavian Barnes | 2021-12-05 | 1 | -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.3 | Tavian Barnes | 2021-11-25 | 1 | -1/+0 | |
| | ||||||
* | Release 2.3 | Tavian Barnes | 2021-11-25 | 4 | -3/+25 | |
| | ||||||
* | exec: Add a bit of backoff during ARG_MAX bisection | Tavian Barnes | 2021-11-23 | 1 | -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 E2BIG | Tavian Barnes | 2021-11-17 | 2 | -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 Barnes | 2021-10-19 | 2 | -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 crashes | Tavian Barnes | 2021-10-19 | 1 | -47/+61 | |
| | ||||||
* | tests: Set abort_on_error=1 for the sanitizers | Tavian Barnes | 2021-10-19 | 1 | -0/+6 | |
| | | | | This makes it easier to distinguish crashes from expected failures | |||||
* | parse: Fix UAF + double-free when ftruncate() fails | Tavian Barnes | 2021-10-19 | 1 | -5/+8 | |
| | ||||||
* | printf: Colorize file names/paths in simple cases | Tavian Barnes | 2021-10-09 | 3 | -8/+76 | |
| | ||||||
* | color: New %pF format for file names | Tavian Barnes | 2021-10-09 | 2 | -5/+36 | |
| | ||||||
* | printf: Take a CFILE, not a FILE | Tavian Barnes | 2021-10-09 | 3 | -65/+66 | |
| | ||||||
* | ci/codecov: Disable status checks | Tavian Barnes | 2021-10-02 | 1 | -0/+4 | |
| | ||||||
* | tests: Add a test for an operator in an unexpected position | Tavian Barnes | 2021-10-01 | 1 | -0/+5 | |
| | ||||||
* | tests: Add tests for parsing invalid integers | Tavian Barnes | 2021-10-01 | 2 | -4/+41 | |
| | | | | And give some better error messages. | |||||
* | tests: Add a tests for missing and nonexistent paths | Tavian Barnes | 2021-10-01 | 1 | -0/+20 | |
| | ||||||
* | ci: Add a codecov.io workflow | Tavian Barnes | 2021-09-28 | 1 | -0/+31 | |
| | ||||||
* | Don't truncate files until we know they're not duplicates | Tavian Barnes | 2021-09-26 | 8 | -68/+115 | |
| | ||||||
* | util: New xfopen() utility | Tavian Barnes | 2021-09-21 | 5 | -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 manpage | Tavian Barnes | 2021-09-21 | 1 | -1/+1 | |
| | ||||||
* | ctx: Also deduplicate the standard streams | Tavian Barnes | 2021-09-21 | 6 | -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/fixes | Tavian Barnes | 2021-09-20 | 1 | -4/+2 | |
|\ | | | | | Remove completion hashbang | |||||
| * | Trim excess whitespace | a1346054 | 2021-09-20 | 1 | -1/+1 | |
| | | ||||||
| * | Avoid using a misleading hashbang | a1346054 | 2021-09-20 | 1 | -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 docs | Tavian Barnes | 2021-09-15 | 2 | -2/+2 | |
| | ||||||
* | tests: Make the -files0-from tests weirder | Tavian Barnes | 2021-09-15 | 3 | -103/+65 | |
| | ||||||
* | Implement -files0-from FILE | Tavian Barnes | 2021-09-15 | 6 | -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 it | Tavian Barnes | 2021-09-15 | 2 | -27/+34 | |
| | ||||||
* | spawn: Plug some leaks on error paths | Tavian Barnes | 2021-09-15 | 1 | -0/+2 | |
| | ||||||
* | eval: Remove an extra space from -ls output | Tavian Barnes | 2021-09-02 | 1 | -1/+1 | |
| | ||||||
* | eval: Use 512-byte blocks for -ls when POSIXLY_CORRECT is set | Tavian Barnes | 2021-09-02 | 4 | -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 scripts | Tavian Barnes | 2021-08-05 | 7 | -7/+7 | |
| | | | | This should reduce the need for patches on the BSDs. | |||||
* | expr: Remove unneeded forward declaration of struct expr | Tavian Barnes | 2021-07-27 | 1 | -5/+3 | |
| | ||||||
* | color: Fix a leak on unknown color keys | Tavian Barnes | 2021-06-16 | 1 | -2/+7 | |
| | | | | Previously reproducible with LS_COLORS="asdf=0" bfs. | |||||
* | parse: More -help pager improvements | Tavian Barnes | 2021-06-13 | 1 | -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 PATH | Tavian Barnes | 2021-06-13 | 2 | -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 environment | Tavian Barnes | 2021-06-13 | 3 | -2/+8 | |
| | ||||||
* | util: New xconfstr() wrapper | Tavian Barnes | 2021-06-13 | 2 | -0/+29 | |
| | ||||||
* | util: Rename fallthrough to BFS_FALLTHROUGH | Tavian Barnes | 2021-06-09 | 4 | -15/+15 | |
| | | | | This avoids shadowing the actually standard name fallthrough. |