Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | color: Squelch a -Wmaybe-uninitialized warning on non-LTO builds | Tavian Barnes | 2024-11-20 | 1 | -1/+1 |
| | |||||
* | color: Handle bfs_check_capabilities error code (-1) in cpath_has_capabilities | Jody Frankowski | 2024-10-31 | 1 | -1/+1 |
| | | | | | | | | | | | On non-Linux systems, bfs_check_capabilities always returned -1, so cpath_has_capabilities would always return true. If bfs was called with an LS_COLORS containing the `ca` statement, e.g. `ca=30;41`, bfs would color ALL the files. While including the `ca` statement in LS_COLORS on non-Linux systems is unusual, this is not an error and is a valid use-case (e.g. Using GNU ls or lsd). Fixes: 1520d4d3 ("color: Don't color files like directories on ENOTDIR") | ||||
* | dstring: Add an infallible dstrshrink() function | Tavian Barnes | 2024-10-17 | 1 | -2/+2 |
| | | | | And mark the fallible ones with _nodiscard. | ||||
* | color: Don't color files like directories on ENOTDIR | Tavian Barnes | 2024-10-16 | 1 | -114/+230 |
| | |||||
* | color: Fix an infinite loop colorizing some invalid paths | Tavian Barnes | 2024-10-13 | 1 | -8/+11 |
| | | | | | | | | | | | | | | Previously, given $ touch file $ ln -s file/file notdir $ bfs notdir/file bfs would loop forever when printing the error message, since it expected stripping the trailing slash from "notdir/" to fix the ENOTDIR error, but the broken symlink still gave the same error. Fixes: b4c3201 ("color: Only highlight the trailing slash on ENOTDIR") | ||||
* | Adjust in/out parameter docs | Tavian Barnes | 2024-10-10 | 1 | -1/+1 |
| | |||||
* | color: Fix an assertion failure with embedded NUL bytes | Tavian Barnes | 2024-10-02 | 1 | -0/+10 |
| | | | | | | | | | | | | | Leading NUL bytes (e.g. `*\0.gz=...`) could cause us to insert a non-prefix-free set of strings into the case-insensitive extension trie, which would lead to crashes like bfs: trie_split@src/trie.c:538: Assertion failed: `key_nibble != rep_nibble` and OOB accesses to trie leaf keys. Fix it by ignoring those extensions, since filenames cannot contain NUL bytes. Fixes: 08030aea ("color: Delay the case_sensitive decision") | ||||
* | Write @arg instead of @param arg in doc comments | Tavian Barnes | 2024-10-01 | 1 | -6/+6 |
| | |||||
* | Fix spelling | Tavian Barnes | 2024-09-23 | 1 | -1/+1 |
| | |||||
* | build: Move feature test macros to prelude.h | Tavian Barnes | 2024-08-28 | 1 | -1/+0 |
| | | | | | | This replaces the explicit CPPFLAGS list in flags.mk with just `-include src/prelude.h`, shortening our compiler command lines and allowing them to be easily documented. | ||||
* | prelude: Split bfs-specific utilities into new bfs.h header | Tavian Barnes | 2024-08-28 | 1 | -0/+3 |
| | |||||
* | expr: Tell expressions what kind of expression they are | Tavian Barnes | 2024-08-15 | 1 | -8/+14 |
| | |||||
* | prelude: Simplify attributes | Tavian Barnes | 2024-07-28 | 1 | -2/+2 |
| | |||||
* | color: Delay the case_sensitive decision | Tavian Barnes | 2024-07-02 | 1 | -90/+84 |
| | |||||
* | Use dstrx*() over dstrn*() when we know the exact length | Tavian Barnes | 2024-06-18 | 1 | -6/+6 |
| | |||||
* | expr: New for_expr macro | Tavian Barnes | 2024-05-23 | 1 | -1/+1 |
| | |||||
* | Stop using %m | Tavian Barnes | 2024-05-20 | 1 | -7/+0 |
| | |||||
* | Cast AT_FDCWD to int for comparisons | Tavian Barnes | 2024-05-17 | 1 | -1/+1 |
| | | | | | Some platforms define AT_FDCWD to a constant like 0xFFFAFDCD that gets typed as an unsigned int. | ||||
* | ctx: Try to reset TTY state when terminating abnormally | Tavian Barnes | 2024-05-16 | 1 | -11/+37 |
| | | | | Fixes: https://github.com/tavianator/bfs/issues/138 | ||||
* | Rename config.h to prelude.h | Tavian Barnes | 2024-04-19 | 1 | -1/+1 |
| | |||||
* | color: New API to check if stat() is necessary | Tavian Barnes | 2024-02-06 | 1 | -0/+5 |
| | |||||
* | expr: Make expressions variadic | Tavian Barnes | 2024-01-07 | 1 | -21/+18 |
| | | | | | | | | | Rather than only unary/binary expressions, we now support an arbitrary number of children. The optimizer has been re-written almost completely and now supports optimal reordering of longer expression chains, rather than just arm-swapping. Fixes #85. | ||||
* | config: s/attr_format/attr_printf/ | Tavian Barnes | 2023-12-18 | 1 | -2/+2 |
| | |||||
* | config: New variadic attr(...) macro | Tavian Barnes | 2023-12-18 | 1 | -2/+2 |
| | |||||
* | color: Make sure errno is non-zero if parse_colors() fails | Tavian Barnes | 2023-11-28 | 1 | -43/+43 |
| | |||||
* | config: s/BFS_FORMATTER/attr_format/ | Tavian Barnes | 2023-11-09 | 1 | -2/+2 |
| | |||||
* | bfstd: Add a thread-safe wrapper for strerror() | Tavian Barnes | 2023-10-05 | 1 | -1/+1 |
| | |||||
* | Formatting fixes | Tavian Barnes | 2023-09-27 | 1 | -3/+3 |
| | |||||
* | dstring: New dchar typedef for dynamic strings | Tavian Barnes | 2023-09-26 | 1 | -3/+3 |
| | |||||
* | Use the new list macros | Tavian Barnes | 2023-09-25 | 1 | -1/+1 |
| | |||||
* | trie: New trie_clear() function | Tavian Barnes | 2023-08-31 | 1 | -2/+1 |
| | |||||
* | color: Only highlight the trailing slash on ENOTDIR | Tavian Barnes | 2023-07-13 | 1 | -2/+4 |
| | |||||
* | color: Don't break up leading and trailing dirs | Tavian Barnes | 2023-07-13 | 1 | -27/+32 |
| | |||||
* | color: TTY-escape filenames | Tavian Barnes | 2023-07-13 | 1 | -1/+9 |
| | |||||
* | color: Get rid of EXT_MAX | Tavian Barnes | 2023-07-13 | 1 | -10/+30 |
| | |||||
* | bfstd: Support wordesc() without allocating | Tavian Barnes | 2023-07-13 | 1 | -13/+7 |
| | |||||
* | diag: Shell-escape expression arguments | Tavian Barnes | 2023-07-06 | 1 | -3/+3 |
| | |||||
* | color: Don't print unnecessary reset sequences | Tavian Barnes | 2023-06-30 | 1 | -24/+43 |
| | |||||
* | color: Compare values too when deciding to smart-case | Tavian Barnes | 2023-06-30 | 1 | -16/+65 |
| | |||||
* | color: Implement smart casing | Tavian Barnes | 2023-06-29 | 1 | -219/+372 |
| | | | | | | | | | Since coreutils 9.2, ls does case-sensitive extension matching if the same extension is capitalized differently in $LS_COLORS. Implement the same logic. Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33123 Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=9086 | ||||
* | alloc: New header for memory allocation utilities | Tavian Barnes | 2023-06-20 | 1 | -2/+3 |
| | |||||
* | color: New %pq formatter for shell-escaped strings | Tavian Barnes | 2023-06-16 | 1 | -0/+18 |
| | |||||
* | color: `fi=0` should not fall back to `no` | Tavian Barnes | 2023-06-08 | 1 | -4/+4 |
| | |||||
* | Switch from assert() to bfs_assert()/bfs_verify() | Tavian Barnes | 2023-05-18 | 1 | -3/+2 |
| | |||||
* | Use bfs_bug("...") over assert(!"...") | Tavian Barnes | 2023-05-18 | 1 | -1/+2 |
| | |||||
* | config: Provide <stdalign.h> and <stdbool.h> | Tavian Barnes | 2023-05-11 | 1 | -1/+0 |
| | | | | In anticipation of C23, since those headers won't be necessary any more. | ||||
* | Replace license boilerplate with SPDX tags | Tavian Barnes | 2023-01-25 | 1 | -15/+2 |
| | | | | | | | And while I'm at it, remove years from copyright declarations. Link: https://spdx.dev/about/ Link: https://daniel.haxx.se/blog/2023/01/08/copyright-without-years/ | ||||
* | bfstd: New wrappers for dirname()/basename() | Tavian Barnes | 2023-01-19 | 1 | -1/+1 |
| | |||||
* | Add BFS_FORMATTER() to vprintf()-type functions too | Tavian Barnes | 2022-12-08 | 1 | -0/+2 |
| | |||||
* | expr: Rename bfs_expr_has_children() to _is_parent() | Tavian Barnes | 2022-12-05 | 1 | -1/+1 |
| |