Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | util: Factor out checks for nonexistent paths/broken links | Tavian Barnes | 2017-09-06 | 3 | -3/+12 | |
| | ||||||
* | parse: Factor out common initialization code for -print and friends | Tavian Barnes | 2017-09-06 | 1 | -35/+30 | |
| | ||||||
* | tests: Test hardlinks to symlinks | Tavian Barnes | 2017-09-06 | 13 | -0/+20 | |
| | ||||||
* | tests: Make test_deep pass with other find implementations | Tavian Barnes | 2017-09-04 | 3 | -22/+37 | |
| | | | | | And move test_deep_strict to the bfs-specific tests, since it's not likely to ever pass for other implementations. | |||||
* | Implement -D search | Tavian Barnes | 2017-09-02 | 3 | -6/+111 | |
| | ||||||
* | tests: Use human-readable filenames in links/ | Tavian Barnes | 2017-09-02 | 33 | -142/+128 | |
| | ||||||
* | mtab: Use __has_include() to check for <mntent.h> | Tavian Barnes | 2017-09-02 | 1 | -4/+15 | |
| | | | | | This fixes the build against musl, as long as you have a new enough compiler for __has_include. | |||||
* | Implement cost-based optimization | Tavian Barnes | 2017-08-27 | 5 | -61/+254 | |
| | ||||||
* | printf: Save some lines in time specifier parsing | Tavian Barnes | 2017-08-27 | 1 | -36/+4 | |
| | ||||||
* | Avoid multiple extra stat()s of broken symlinks for -xtype | Tavian Barnes | 2017-08-22 | 5 | -13/+18 | |
| | ||||||
* | tests: Remove unnecessary sort-args.sh invocations | Tavian Barnes | 2017-08-16 | 3 | -40/+40 | |
| | ||||||
* | tests: Add some syntax highlighting to --verbose | Tavian Barnes | 2017-08-12 | 1 | -3/+22 | |
| | ||||||
* | Unify broken symlink handling | Tavian Barnes | 2017-08-12 | 11 | -33/+74 | |
| | | | | | | | | | Rather than open-code the fallback logic for broken symlinks everywhere it's needed, introduce a new xfstatat() utility function that performs the fallback automatically. Using xfstatat() consistently fixes a few bugs, including cases where broken symlinks are given as arguments to predicates like -samefile. | |||||
* | tests: Add a test for -exec ... {} + with a failing command | Tavian Barnes | 2017-08-12 | 2 | -0/+27 | |
| | ||||||
* | Update README.md | Tavian Barnes | 2017-08-10 | 1 | -4/+16 | |
| | ||||||
* | bftw: Assert that the queue is empty when freeing it | Tavian Barnes | 2017-08-10 | 1 | -0/+1 | |
| | ||||||
* | parse: Don't allow negative optimization levels | Tavian Barnes | 2017-08-10 | 1 | -1/+1 | |
| | ||||||
* | Release 1.1.11.1.1 | Tavian Barnes | 2017-08-10 | 3 | -2/+11 | |
| | ||||||
* | exec: Fix more corner cases with -ok ... + | Tavian Barnes | 2017-07-29 | 4 | -9/+58 | |
| | | | | -ok should look for a ; even if it sees {} +, according to POSIX. | |||||
* | tests.sh: Add a --verbose mode | Tavian Barnes | 2017-07-29 | 1 | -22/+58 | |
| | ||||||
* | exec: Don't allow anything between {} and + | Tavian Barnes | 2017-07-29 | 7 | -117/+99 | |
| | | | | | | | | | POSIX explicitly forbids this extension: > Only a <plus-sign> that immediately follows an argument containing > only the two characters "{}" shall punctuate the end of the primary > expression. Other uses of the <plus-sign> shall not be treated as > special. | |||||
* | util: Define O_DIRECTORY to 0 if it's not already defined | Tavian Barnes | 2017-07-29 | 4 | -15/+7 | |
| | ||||||
* | Re-license under the BSD Zero Clause License | Tavian Barnes | 2017-07-27 | 23 | -234/+343 | |
| | ||||||
* | Release 1.11.1 | Tavian Barnes | 2017-07-22 | 3 | -2/+20 | |
| | ||||||
* | Represent never returning as always_true && always_false | Tavian Barnes | 2017-07-21 | 3 | -34/+42 | |
| | | | | | | | | | | Expressions that never return are vacuously always both true and false. Using this representation lets us take advantage of existing truth-based optimizations, which gets us optimizations of command lines like bfs -name foo -quit -print for free. | |||||
* | Fix a couple terrible optimizer bugs | Tavian Barnes | 2017-07-21 | 4 | -2/+14 | |
| | | | | | | | Just because an expression is always true or false, doesn't mean we can execute it more often than it otherwise would be, unless it's also pure. But that's equivalent to being identically -true/-false, so just check that. | |||||
* | Implement -printx | Tavian Barnes | 2017-07-21 | 5 | -0/+81 | |
| | | | | Also from NetBSD. | |||||
* | main: Call setlocale() at startup to use the system locale | Tavian Barnes | 2017-07-20 | 2 | -0/+14 | |
| | ||||||
* | eval: Add some sanity checks | Tavian Barnes | 2017-07-20 | 4 | -0/+35 | |
| | ||||||
* | Implement -exit [STATUS] | Tavian Barnes | 2017-07-20 | 6 | -12/+75 | |
| | | | | From NetBSD again. | |||||
* | Implement -rm as an alias for -delete | Tavian Barnes | 2017-07-20 | 4 | -4/+25 | |
| | | | | From NetBSD. | |||||
* | Revert "tests.sh: Better line overwriting" | Tavian Barnes | 2017-07-20 | 1 | -4/+5 | |
| | | | | | | This reverts commit 4b02d5dae771a8797868ccaddf1bbb7cf0b67c2b. Overwriting the last line of the test output is worse. | |||||
* | tests.sh: Better line overwriting | Tavian Barnes | 2017-07-18 | 1 | -5/+4 | |
| | | | | | This way the cursor is always at the beginning of the line, so any error output is more readable. | |||||
* | tests.sh: Make closefrom() behave like its namesake | Tavian Barnes | 2017-07-18 | 1 | -3/+3 | |
| | ||||||
* | tests.sh: Close extraneous fds for tests that depend on ulimit | Tavian Barnes | 2017-07-16 | 1 | -0/+17 | |
| | ||||||
* | parse: Ask for confirmation in some cases | Tavian Barnes | 2017-07-16 | 2 | -108/+157 | |
| | ||||||
* | Handle yes/no prompts correctly according to the locale | Tavian Barnes | 2017-07-15 | 3 | -7/+80 | |
| | ||||||
* | parse: Warn if -depth and -prune are used together | Tavian Barnes | 2017-07-09 | 1 | -0/+19 | |
| | ||||||
* | Handle ENOTDIR the same as ENOENT | Tavian Barnes | 2017-07-09 | 11 | -3/+21 | |
| | | | | | | For a/b/c, ENOTDIR is returned instead of ENOENT if a or b are not directories. Handle this uniformly when detecting broken symlinks, readdir races, etc. | |||||
* | bftw: Rename and refactor the internals | Tavian Barnes | 2017-07-09 | 1 | -235/+257 | |
| | ||||||
* | bftw: Fix ENAMETOOLONG handling when the root is closed | Tavian Barnes | 2017-07-08 | 4 | -12/+33 | |
| | | | | | The root has depth == 0, but we still need to include it in the components array. | |||||
* | exec: Clear errno when a multi-exec doesn't fail | Tavian Barnes | 2017-07-08 | 1 | -1/+6 | |
| | | | | | | | This fixes strange "Inappropriate ioctl for device" errors when using -exec ... + with output redirection. errno was set to ENOTTY by the isatty() call during startup for color auto-detection, and never cleared before eval_exec() wants to check if anything went wrong. | |||||
* | bftw: Recover from ENAMETOOLONG | Tavian Barnes | 2017-07-08 | 3 | -23/+137 | |
| | | | | | | | | | | | | | | | | | | | | | | | | It is always possible to force a breadth-first traversal to encounter ENAMETOOLONG, regardless of the dircache eviction policy. As a concrete example, consider this directory structure: ./1/{NAME_MAX}/{NAME_MAX}/{NAME_MAX}/... (longer than {PATH_MAX}) ./2/{NAME_MAX}/{NAME_MAX}/{NAME_MAX}/... ./3/{NAME_MAX}/{NAME_MAX}/{NAME_MAX}/... ... (more than RLIMIT_NOFILE directories under .) Eventually, the next file to be processed will not have any parents in the cache, as the cache can only hold RLIMIT_NOFILE entries. Then the whole path must be traversed from ., which will exceed {PATH_MAX} bytes. Work around this by performing a component-by-component traversal manually when we see ENAMETOOLONG. This is required by POSIX: > The find utility shall be able to descend to arbitrary depths in a file > hierarchy and shall not fail due to path length limitations (unless a > path operand specified by the application exceeds {PATH_MAX} > requirements). | |||||
* | Revert "bftw: Don't store the terminating '\0' in dircache_entry names." | Tavian Barnes | 2017-07-08 | 1 | -1/+2 | |
| | | | | | | | This reverts commit 20860becb5a0e89ee2aaaddbb0ba1eb248552640. The terminating NUL will be useful for the upcoming per-component traversal to handle ENAMETOOLONG. | |||||
* | Release 1.0.21.0.2 | Tavian Barnes | 2017-06-15 | 3 | -2/+13 | |
| | ||||||
* | -perm: Handle permcopy (e.g. u=rw,g=u) correctly | Tavian Barnes | 2017-06-15 | 3 | -5/+22 | |
| | ||||||
* | tests: Fix test_printf_nul with non-GNU sort | Tavian Barnes | 2017-06-11 | 2 | -1/+7 | |
| | | | | | Other UNIX sort implementations seem to truncate at the nul bytes, so open-code it without the sort. | |||||
* | printf: Fix embedded nul bytes | Tavian Barnes | 2017-06-10 | 5 | -11/+37 | |
| | | | | Fixes #26. | |||||
* | parse: Make some error messages red | Tavian Barnes | 2017-06-03 | 1 | -2/+4 | |
| | ||||||
* | Add Homebrew installation instructions | Peter Brunner | 2017-06-03 | 1 | -0/+2 | |
| |