summaryrefslogtreecommitdiffstats
path: root/eval.c
Commit message (Collapse)AuthorAgeFilesLines
* eval: Fix -delete when following symlinks.Tavian Barnes2018-07-121-2/+15
| | | | | Same bug as https://savannah.gnu.org/bugs/?46305. Please don't ever do this though.
* eval: Don't use %m to report a non-errno errorTavian Barnes2018-06-191-1/+1
| | | | Fixes: 2a45ad01e211d0b36056c21d5211be46195b273d
* eval: Don't unnecessarily zero fields in struct eval_stateTavian Barnes2018-02-011-7/+6
| | | | | | The designated initializer causes everything not mentioned to be zeroed, a waste of time that shows up on profiles. It also has the potential to hide uninitialized-use bugs.
* stat: New wrapper around the stat() familyTavian Barnes2018-01-081-94/+82
| | | | | This lets bfs transparently support the new statx() system call on Linux, giving it access to file birth times.
* Keep track of required FDs per-exprTavian Barnes2017-12-151-1/+3
|
* color: Implement %m for cfprintf()Tavian Barnes2017-11-131-4/+4
|
* exec: Fix error reportingTavian Barnes2017-11-121-5/+9
|
* cmdline: Account for files opened during/between evaluations more carefullyTavian Barnes2017-11-121-2/+1
|
* Add support for file birth/creation times on platforms that have itTavian Barnes2017-11-051-19/+37
| | | | Fixes #19
* Use "error:" prefix consistentlyTavian Barnes2017-10-221-4/+4
|
* util: Wrap faccessat() to fix some portability issuesTavian Barnes2017-09-201-1/+1
|
* opt: Move some aggressive optimizations back to -O4Tavian Barnes2017-09-171-8/+1
|
* opt: Separate optimization from parsingTavian Barnes2017-09-161-1/+4
|
* eval: Make sure nopenfd >= 2 for bftw()Tavian Barnes2017-09-091-6/+5
|
* Try /proc/self/fd before /dev/fdTavian Barnes2017-09-091-3/+6
| | | | On Solaris, /proc/self/fd is dynamic while /dev/fd is static.
* util: Factor out checks for nonexistent paths/broken linksTavian Barnes2017-09-061-2/+2
|
* Implement -D searchTavian Barnes2017-09-021-0/+100
|
* Implement cost-based optimizationTavian Barnes2017-08-271-13/+10
|
* Avoid multiple extra stat()s of broken symlinks for -xtypeTavian Barnes2017-08-221-4/+9
|
* Unify broken symlink handlingTavian Barnes2017-08-121-16/+6
| | | | | | | | | 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.
* util: Define O_DIRECTORY to 0 if it's not already definedTavian Barnes2017-07-291-5/+1
|
* Re-license under the BSD Zero Clause LicenseTavian Barnes2017-07-271-10/+15
|
* Represent never returning as always_true && always_falseTavian Barnes2017-07-211-3/+6
| | | | | | | | | | 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.
* Implement -printxTavian Barnes2017-07-211-0/+38
| | | | Also from NetBSD.
* eval: Add some sanity checksTavian Barnes2017-07-201-0/+6
|
* Implement -exit [STATUS]Tavian Barnes2017-07-201-9/+19
| | | | From NetBSD again.
* Handle ENOTDIR the same as ENOENTTavian Barnes2017-07-091-2/+2
| | | | | | 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.
* Pass AT_EACCESS to faccessat()Tavian Barnes2017-04-301-1/+1
| | | | | That's the form that actually answers the expected question ("can I open() this"), and the only form Hurd supports.
* Don't forget an access mode to openat() in -emptyTavian Barnes2017-04-301-1/+1
|
* Release 1.01.0Tavian Barnes2017-04-241-1/+1
|
* Implement -fstypeTavian Barnes2017-04-231-0/+14
| | | | Fixes #6!
* Implement -XTavian Barnes2017-04-161-0/+7
|
* Implement -exec/-execdir ... +Tavian Barnes2017-04-151-189/+15
|
* Move bftw_typeflag converters to util.cTavian Barnes2017-04-081-1/+1
|
* Color link targets for -lsTavian Barnes2017-03-161-7/+1
| | | | Fixes #18.
* Give struct expr a CFILE* instead of just a FILE*Tavian Barnes2017-03-161-36/+14
| | | | This unifies the behaviour of -print and -fprint /dev/stdout.
* Implement -ls and -flsTavian Barnes2017-03-111-0/+105
|
* Make a printf()-style API for colored messagesTavian Barnes2017-03-111-9/+7
|
* bftw: Make the nameoff of "///" point to "/"Tavian Barnes2017-02-091-8/+3
| | | | This simplifies a few things such as -name handling for ///.
* Don't close stdin for -ok or -okdirTavian Barnes2017-02-091-9/+0
| | | | Turns out it violates POSIX, even though GNU find does it.
* Add support for -x?type with multiple typesTavian Barnes2017-02-081-28/+2
| | | | This functionality is already part of GNU findutils git.
* Add some missing perror() callsTavian Barnes2017-02-071-20/+16
|
* Make -quit happen immediately, not at the end of the current expressionTavian Barnes2017-02-051-3/+31
|
* Implement -printf/-fprintfTavian Barnes2017-02-051-30/+47
| | | | | Based on a patch by Fangrui Song <i@maskray.me>. Closes #16.
* Implement -nouser and -nogroupTavian Barnes2017-02-041-0/+26
|
* Don't trust st_size when reading symlinksTavian Barnes2017-01-311-12/+1
| | | | | Linux /proc, for example, reports a st_size of 0 for everything. It's nice to be able to use -lname on them anyway.
* Simplify exec_chdir()Tavian Barnes2017-01-141-16/+10
| | | | | | 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`).
* eval: Check that O_DIRECTORY is defined before using itTavian Barnes2017-01-021-1/+5
|
* Add tera and peta suffices for -sizeTavian Barnes2016-12-201-2/+4
|
* Implement -sparse from FreeBSD findTavian Barnes2016-12-201-0/+13
|