summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Makefile: New gcov targetTavian Barnes2020-11-102-1/+9
|
* opt: Assert that we don't do disabled optimizationsTavian Barnes2020-11-101-0/+2
|
* tests: Improve test coverage a bitTavian Barnes2020-11-1013-0/+350
|
* tests: Add missing expectations from dd3bbb9Tavian Barnes2020-11-092-0/+38
|
* opt: Predicates aren't true when they're falseTavian Barnes2020-11-092-2/+14
| | | | | | | | | | | | This unfortunate typo was mostly harmless; since the predicates were always assumed to be true, they wouldn't conflict. The exception is -user/-group, which set -nouser/-nogroup to false for users/groups that exist. Even -O0 wasn't enough to suppress the bug, due to a missing optlevel check fixed in the previous commit. Fixes: 305ee902874b49351f4916e303c293523f11570b
* opt: Check optlevel before removing unreachable expressionsTavian Barnes2020-11-091-2/+4
|
* Use two newlines for all pre-eval warningsTavian Barnes2020-11-092-2/+2
|
* 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-046-11/+11
|
* spawn: Fix error pipe write failure handlingTavian Barnes2020-11-041-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A short history lesson: this code (from exec.c) used to just be write(...); In 649d85b, an empty if block was added to placate _FORTIFY_SOURCE's warn_unused_result: if (write(...) != sizeof(error)) { // ... } This is fine since the parent doesn't rely on receiving those writes (e.g. the child could die before writing), and the small write to a pipe won't fail anyway. But when bfs_spawn() was created, the implementation changed to this: while (write(...) < sizeof(error)); The while loop was presumably added to mirror musl's posix_spawn() implementation, which handles EINTR. But musl's is actually correct: while (write(...) < 0); whereas mine has a subtle bug: since sizeof(error) is unsigned, the bfs code did an unsigned comparison, meaning -1 from write() would *not* restart the loop. Fix it by comparing with 0 like musl, since short writes are impossible here. Perhaps it's time for -Wsign-compare, despite the other 18 instances being false positives.
* Makefile: Fail early on sanitizer errorsTavian Barnes2020-11-031-0/+8
|
* New -status option to display a status barTavian Barnes2020-11-035-14/+122
|
* bar: Implement terminal status barsTavian Barnes2020-11-033-0/+320
|
* dstring: New dstrvprintf() functionTavian Barnes2020-11-032-9/+28
|
* Update the project URLTavian Barnes2020-10-142-2/+2
|
* Release 2.02.0Tavian Barnes2020-10-143-3/+7
|
* util: New BFS_FLEX_SIZEOF() macro for more precise flexible array allocationsTavian Barnes2020-10-134-4/+28
| | | | | See http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_282.htm for all the fun behind this.
* pwcache: Adjust some naming conventionsTavian Barnes2020-10-063-14/+14
|
* mtab: Adjust some naming conventionsTavian Barnes2020-10-063-7/+7
|
* expr, eval: Clean up header dependenciesTavian Barnes2020-10-063-19/+23
|
* exec: Adjust some calling conventionsTavian Barnes2020-10-063-11/+11
|
* printf: Adjust some calling conventionsTavian Barnes2020-10-063-22/+22
|
* ctx: Don't include color.hTavian Barnes2020-10-061-4/+4
|
* diag: New bfs_perror() functionTavian Barnes2020-10-056-37/+53
|
* parse: Fail if -color is passed and the colors couldn't be parsedTavian Barnes2020-10-043-0/+13
|
* parse: More accurate error reporting for cfdup()Tavian Barnes2020-10-041-1/+7
|
* parse: Report errors when failing to add a rootTavian Barnes2020-10-041-1/+5
|
* diag: Factor debug_flag string conversion into its own functionTavian Barnes2020-10-041-25/+21
|
* time: Don't call tzset() on every x{local,gm}time()Tavian Barnes2020-10-011-2/+11
| | | | It turns out tzset() checks /etc/localtime every time you call it.
* dstring: Try to avoid calling vsnprintf() twice in dstrprintf()Tavian Barnes2020-10-011-10/+26
|
* main: Preserve errno over close() in redirect()Tavian Barnes2020-10-011-6/+7
|
* util: Move redirect() and isopen() to main.cTavian Barnes2020-10-013-48/+22
|
* util: Don't rely on bftwTavian Barnes2020-09-304-40/+39
| | | | And rename format_mode() to xstrmode() while I'm at it.
* ctx: Perserve errno better in bfs_ctx_open()Tavian Barnes2020-09-281-0/+7
|
* Rename struct cmdline to bfs_ctxTavian Barnes2020-09-2718-562/+786
| | | | | The API remains similar, with some added accessor functions for lazy initialization of the pwcache and mtab.
* exec: Output a human-readable description of terminating signalsTavian Barnes2020-09-231-1/+5
|
* bftw: Fix bftw_cached_stat() with BFS_STAT_TRYFOLLOWTavian Barnes2020-09-201-1/+5
|
* tests: Add missing ground truthTavian Barnes2020-09-201-0/+12
|
* printf: Format the empty string for %l of non-linksTavian Barnes2020-09-202-9/+15
| | | | It makes a difference if the format specifier has a width.
* stat: Rename bfs_stat_flag to _flagsTavian Barnes2020-09-187-23/+23
| | | | Flags enums should be plural.
* Don't call stat() just to determine symbolic lengthsTavian Barnes2020-09-185-11/+30
| | | | | | | 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.
* util: Make the initial allocation bigger for xreadlinkat()Tavian Barnes2020-09-181-1/+6
| | | | | | | | | Most symlinks are more than 1 character long, so rather than wasting time with 1, 2, 4, ... when we don't have a good guess for the length, start with a bigger one. Credit to https://twitter.com/RichFelker/status/1306321019108556806 for reminding me of this.
* pwcache: Fix an invalid free if strdup()ing the group name failsTavian Barnes2020-09-021-3/+4
|
* pwcache: Work around gr_mem being misaligned on macOSTavian Barnes2020-08-131-3/+14
| | | | C.f. https://github.com/php/php-src/commit/d80f0ff6c0a557d8c993a9d2bd006fb488f6d564
* Implement -xattrnameTavian Barnes2020-08-1312-20/+159
| | | | From macOS find.
* bftw: Make some flag names more explicitTavian Barnes2020-07-294-36/+36
|
* bftw: Rename bftw_typeflag to bftw_type, and make it not a bitmaskTavian Barnes2020-07-299-107/+106
|
* Update default branch to 'main'Tavian Barnes2020-07-101-2/+2
|
* eval: Fix an assertion failure with -D search -sTavian Barnes2020-06-161-0/+1
|