summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-04-24Release 1.01.0Tavian Barnes
2017-04-23Implement -fstypeTavian Barnes
Fixes #6!
2017-04-16Make -help output prettier and more completeTavian Barnes
2017-04-16tests.sh: Allow individual tests to be specified on the command lineTavian Barnes
2017-04-16Implement -XTavian Barnes
2017-04-16tests: Add tests for bfs extensions to -exec ... +Tavian Barnes
2017-04-15exec: Interpret ARG_MAX corretly.Tavian Barnes
Thanks to https://www.in-ulm.de/~mascheck/various/argmax/
2017-04-15exec: close() the working directory even if !ftwbufTavian Barnes
2017-04-15Implement -exec/-execdir ... +Tavian Barnes
2017-04-13util.h: Don't use a forward reference to enum bftw_typeflagTavian Barnes
Apparently that's not allowed in standard C.
2017-04-08tests.sh: Use eval instead of declare -gTavian Barnes
Turns out declare -g is from Bash 4 too.
2017-04-08Move bftw_typeflag converters to util.cTavian Barnes
2017-03-22bftw: Only rebuild the part of the path that changesTavian Barnes
Quadratic complexity is still possible for directory structures like root -- a -- a -- a -- a ... | +- b -- b -- b -- b ... But for most realistic directory structures, bfs should now spend less time building paths. (Of course if you print every path, overall complexity is quadratic anyway.)
2017-03-20bftw: Fix quadratic reference counting complexityTavian Barnes
dircache_entry refcounts used to count every single descendant, resulting in n refcount updates to create/delete an entry at depth n, and thus O(n^2) complexity overall for deep directory structures. Fix it by only counting direct children instead. The cache eviction policy is changed to prefer shallower entries in all cases, attempting to save at least some of the benefit of the previous accounting scheme. Unfortunately, the average number of traversed components for openat() calls still went up by ~20%, but the performance in practice is roughly unchanged in my tests.
2017-03-16Respect -nocolor for -fprint /dev/stdoutTavian Barnes
2017-03-16Color link targets for -lsTavian Barnes
Fixes #18.
2017-03-16Give struct expr a CFILE* instead of just a FILE*Tavian Barnes
This unifies the behaviour of -print and -fprint /dev/stdout.
2017-03-11Release 0.960.96Tavian Barnes
2017-03-11Implement -ls and -flsTavian Barnes
2017-03-11tests: Run everything in UTCTavian Barnes
2017-03-11Add a test for colored outputTavian Barnes
2017-03-11Make a printf()-style API for colored messagesTavian Barnes
2017-03-11Implement -printf %Ak, %Ck, and %TkTavian Barnes
2017-02-11tests: Print the count of passing and failing testsTavian Barnes
2017-02-11Add some tests for the operators themselvesTavian Barnes
2017-02-11Allow short-circuiting optimizations with non-pure operandsTavian Barnes
2017-02-10Add tests for bfs's flexible command line parsingTavian Barnes
2017-02-10tests: Don't require bash associative arraysTavian Barnes
That's a bash 4 feature, while macOS is stuck on bash 3.
2017-02-09bftw: Make the nameoff of "///" point to "/"Tavian Barnes
This simplifies a few things such as -name handling for ///.
2017-02-09Give the test cases human-readable namesTavian Barnes
2017-02-09Don't close stdin for -ok or -okdirTavian Barnes
Turns out it violates POSIX, even though GNU find does it.
2017-02-09parse: Factor out all "looks like icmp" checksTavian Barnes
2017-02-09bftw: Add the DIR* to bftw_stateTavian Barnes
Can't forget to close it that way.
2017-02-08Add support for -x?type with multiple typesTavian Barnes
This functionality is already part of GNU findutils git.
2017-02-07bftw: Add mising closedir() to error pathTavian Barnes
2017-02-07Bail out if parse_root() failsTavian Barnes
Previously, skip_paths() did not distinguish between end-of-arguments and parse_root() failing, returning NULL in both cases. If parse_root() failed, parsing would attempt to continue, in an unexpected state.
2017-02-07Add some missing perror() callsTavian Barnes
2017-02-06bftw: Plug a leak if dirqueue_push() failsTavian Barnes
If bftw_add() succeeds but dirqueue_push() fails, we need to clean up the just-added dircache_entry. Otherwise it will leak, and we'll also fail the cache->size == 0 assertion. Fix it by extracting the dircache-related parts of bftw_pop() into a new helper function bftw_gc(), and call it from bftw_pop() as well as the bftw_push() failure path.
2017-02-06Fix a memory leak parsing -printfTavian Barnes
2017-02-06tests.sh: Set the umask before creating the test treesTavian Barnes
2017-02-05Make -quit happen immediately, not at the end of the current expressionTavian Barnes
2017-02-05bftw: Compute nameoff correctly for the root in BFTW_DEPTH modeTavian Barnes
2017-02-05Implement -printf/-fprintfTavian Barnes
Based on a patch by Fangrui Song <i@maskray.me>. Closes #16.
2017-02-04Implement -nouser and -nogroupTavian Barnes
2017-01-31Don't trust st_size when reading symlinksTavian Barnes
Linux /proc, for example, reports a st_size of 0 for everything. It's nice to be able to use -lname on them anyway.
2017-01-14Simplify exec_chdir()Tavian Barnes
The previous code recomputed the name offset for no reason, and had an embarrassing typo that was hypothetically a bug (`} if` instead of `} else if`).
2017-01-06Don't set _POSIX_C_SOURCETavian Barnes
The BSD behaviour is to hide all BSD extensions if standard-conformance feature test macros are present. We don't want strict POSIX, we want all available extensions, so ask for that.
2017-01-03tests: Add a test for -inumTavian Barnes
2017-01-02tests: Add tests for -quitTavian Barnes
2017-01-02eval: Check that O_DIRECTORY is defined before using itTavian Barnes