summaryrefslogtreecommitdiffstats
path: root/eval.c
Commit message (Collapse)AuthorAgeFilesLines
* expr: Store auxilliary data in a unionTavian Barnes2022-03-251-115/+121
| | | | And rename struct expr to bfs_expr.
* Don't shadow standard headersTavian Barnes2022-03-121-2/+2
| | | | | | | | | | | | | @italic on the AUR stated that bfs from the AUR fails to build on Manjaro. From the build log, it seems like <time.h> doesn't get included properly. I assume it's picking up ./time.h instead. I couldn't reproduce the build issue in the default configuration, but it does fail with EXTRA_CFLAGS="-I." which isn't good. So rename everything with an x prefix to stop clashing. Link: https://aur.archlinux.org/packages/bfs#comment-856102 Link: https://paste.rs/eqR
* regex: Rework error handlingTavian Barnes2022-02-241-5/+4
|
* regex: Wrap the POSIX API in a facadeTavian Barnes2022-02-211-16/+4
|
* regex: Add support for emacs and grep typesTavian Barnes2022-02-041-2/+2
|
* Standardize WITH_* make variables for configuring dependenciesTavian Barnes2022-01-291-1/+1
|
* Simplifyingdata-man2022-01-241-6/+1
|
* Using Oniguruma library (optionally)data-man2022-01-241-1/+6
|
* 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
* printf: Take a CFILE, not a FILETavian Barnes2021-10-091-1/+1
|
* 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-021-1/+2
| | | | | This matches the behaviour of GNU find, and allows bfs to match the output of BSD find as well. Fixes #77.
* util: Rename fallthrough to BFS_FALLTHROUGHTavian Barnes2021-06-091-2/+2
| | | | This avoids shadowing the actually standard name fallthrough.
* Implement time units for -{a,B,c,m}timeTavian Barnes2021-06-021-3/+5
| | | | From FreeBSD find. Closes #75.
* eval: Raise RLIMIT_NOFILE if possibleTavian Barnes2021-05-201-11/+37
| | | | | | 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()).
* Use `<< {10,20,...}` instead of `*1024*1024...`Tavian Barnes2021-05-201-5/+5
|
* Implement -flags, from FreeBSD findTavian Barnes2021-03-061-0/+34
| | | | This is the last BSD-specific primary I'm aware of. Fixes #14.
* eval: Set the exit status automatically in eval_error()Tavian Barnes2021-03-061-5/+3
|
* Update copyright datesTavian Barnes2021-02-051-1/+1
|
* dir: New DIR* facadeTavian Barnes2021-01-281-58/+50
|
* Enable -Wshadow by defaultTavian Barnes2021-01-281-10/+10
| | | | And fix the one case it warns on.
* -used: Make the implementation match the GNU fixes for findutils 4.8.0Tavian Barnes2021-01-131-2/+7
|
* eval: Make -hidden behave consistentlyTavian Barnes2020-11-281-1/+8
| | | | | | | | | | | | | | | Previously there was an unexpected difference between $ bfs .hidden -hidden and $ bfs ./.hidden -hidden ./.hidden The intent of the code was to avoid considering `.`, the default starting point, as hidden and thus pruning a whole search with -nohidden. Fix it to do that explicitly, and handle `..` too.
* Include what I useTavian Barnes2020-11-121-0/+2
| | | | Thanks to https://github.com/include-what-you-use/include-what-you-use
* Use two newlines for all pre-eval warningsTavian Barnes2020-11-091-1/+1
|
* eval: Fix the status bar to only print the parent againTavian Barnes2020-11-041-5/+7
|
* eval: Make a crude attempt to handle double-width chars in the status barTavian Barnes2020-11-041-11/+49
|
* Enable -Wsign-compare to catch bugs like 726d7801Tavian Barnes2020-11-041-5/+5
|
* New -status option to display a status barTavian Barnes2020-11-031-11/+100
|
* expr, eval: Clean up header dependenciesTavian Barnes2020-10-061-0/+1
|
* diag: New bfs_perror() functionTavian Barnes2020-10-051-6/+6
|
* util: Don't rely on bftwTavian Barnes2020-09-301-1/+1
| | | | And rename format_mode() to xstrmode() while I'm at it.
* Rename struct cmdline to bfs_ctxTavian Barnes2020-09-271-66/+80
| | | | | The API remains similar, with some added accessor functions for lazy initialization of the pwcache and mtab.
* stat: Rename bfs_stat_flag to _flagsTavian Barnes2020-09-181-2/+2
| | | | Flags enums should be plural.
* Don't call stat() just to determine symbolic lengthsTavian Barnes2020-09-181-5/+3
| | | | | | | The new bftw_cached_stat() helper gets us stat info if we already have it, but doesn't call stat() if we don't. In that case we just take a guess for the initial length to readlinkat(). This lets us avoid stat() entirely in many cases for -lname and -printf %l.
* Implement -xattrnameTavian Barnes2020-08-131-0/+13
| | | | From macOS find.
* bftw: Make some flag names more explicitTavian Barnes2020-07-291-6/+6
|
* bftw: Rename bftw_typeflag to bftw_type, and make it not a bitmaskTavian Barnes2020-07-291-37/+35
|
* eval: Fix an assertion failure with -D search -sTavian Barnes2020-06-161-0/+1
|
* eval: Fix a segfault with -D search -S edsTavian Barnes2020-06-161-0/+1
|
* Treat -nohidden like -exclude -hiddenTavian Barnes2020-06-071-12/+0
| | | | Fixes #30.
* Implement -exclude, a special form for convenient exclusionsTavian Barnes2020-06-071-0/+5
| | | | Fixes #8.
* diag: Unify debug printingTavian Barnes2020-06-021-14/+14
|
* pwcache: Rename from passwd.[ch]Tavian Barnes2020-04-221-1/+1
|
* passwd: Cache the user/group tablesTavian Barnes2020-02-291-22/+7
| | | | | | | | | | | | | | | | | | | | | | This is a significant optimization for conditions that need these tables: Benchmark #1: ./bfs ~/code/linux -nouser >/dev/null Time (mean ± σ): 232.0 ms ± 2.5 ms [User: 44.3 ms, System: 185.0 ms] Range (min … max): 228.7 ms … 238.7 ms 12 runs Benchmark #2: ./bfs-1.6 ~/code/linux -nouser >/dev/null Time (mean ± σ): 1.050 s ± 0.012 s [User: 544.2 ms, System: 500.0 ms] Range (min … max): 1.025 s … 1.063 s 10 runs Benchmark #3: find ~/code/linux -nouser >/dev/null Time (mean ± σ): 1.040 s ± 0.012 s [User: 533.6 ms, System: 500.6 ms] Range (min … max): 1.017 s … 1.054 s 10 runs Summary './bfs ~/code/linux -nouser >/dev/null' ran 4.48 ± 0.07 times faster than 'find ~/code/linux -nouser >/dev/null' 4.52 ± 0.07 times faster than './bfs-1.6 ~/code/linux -nouser >/dev/null'
* eval: Irregular files aren't emptyTavian Barnes2020-02-141-1/+1
| | | | | GNU find's -empty returns false for devices, sockets, etc., even though their st_size is 0. Match that behaviour.
* time: Split out time-related functions from utilTavian Barnes2020-02-131-0/+1
|
* Update copyright datesTavian Barnes2020-01-071-1/+1
|
* eval: For -ls, print a + if a file has ACLsTavian Barnes2020-01-071-1/+2
|
* darray: New dynamic array libraryTavian Barnes2019-08-291-1/+2
|