| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
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")
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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")
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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")
|
| |
|
| |
|
|
|
|
|
|
|
| |
POSIX 2024 clarified that find(1) is meant to work exactly like chmod(1)
here, so for modes like +rw,-x with no "who" specified, apply the umask.
Link: https://www.austingroupbugs.net/view.php?id=1392
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The POSIX Utility Syntax Guidelines specify that flag groups like -HL
should be handled like -H -L. GNU find doesn't support grouping flags
in this way, but BSD find does.
To avoid conflicts with non-flag primaries, for now we require at least
one flag in a group to be a capital letter. That is, we support things
like -Lds but not -ds. We also do not support -fPATH (without a space)
as it would conflict with -follow, -fprint, etc. It is impossible to be
compatible with both GNU and BSD find here:
user@gnu$ find -follow
link
link/file
...
user@bsd$ find -follow
find: ollow: No such file or directory
Link: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html
|
| |
|
|
|
|
|
|
|
| |
GNU findutils just made the same change, so looping symlinks will be
considered broken rather than a hard error.
Link: https://savannah.gnu.org/bugs/?51926
|
| |
|
|
|
|
| |
Closes: https://github.com/tavianator/bfs/issues/133
|
|
|
|
| |
Fixes: https://github.com/tavianator/bfs/issues/131
|
| |
|
|
|
|
|
| |
Rather than attempting to close any unexpected FDs, just count them and
adjust our ulimit -n calls to account for them.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The docs say
> Command-line software which adds ANSI color to its output by default
> should check for a NO_COLOR environment variable that, when present
> and not an empty string (regardless of its value), prevents the
> addition of ANSI color.
but we were not checking for the empty string.
Link: https://no-color.org/
Link: https://github.com/sharkdp/fd/pull/1421
|
| |
|
|
|
|
| |
! false doesn't trigger an error with set -e.
|
|
|
|
|
| |
Invoking bfs in the top directory can lead it to explore other tests'
scratch directories, so explicitly exclude them.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
POSIX actually says
> If the utility would be executed with file descriptor 0, 1, or 2
> closed, implementations may execute the utility with the file
> descriptor open to an unspecified file.
So we're not guaranteed to be able to detect the situation in the first
place. Add a best-effort check for these platforms and skip the test.
Link: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01_01
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Otherwise, propagate the exit code from bfs
|
| |
|