diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-07-13 16:00:02 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-07-13 16:04:18 -0400 |
commit | b4c3201ccceb9c73dd7751d7f9937b4afe78966f (patch) | |
tree | 149930ae81ac27d899316165333de4f1aeb50410 /src | |
parent | 0e4dffeb46f3d8bfe30d60a0cfe1e1fa5a082b13 (diff) | |
download | bfs-b4c3201ccceb9c73dd7751d7f9937b4afe78966f.tar.xz |
color: Only highlight the trailing slash on ENOTDIR
Diffstat (limited to 'src')
-rw-r--r-- | src/color.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/color.c b/src/color.c index 7d98978..f7a5d86 100644 --- a/src/color.c +++ b/src/color.c @@ -982,8 +982,10 @@ static ssize_t first_broken_offset(const char *path, const struct BFTW *ftwbuf, while (ret && at_path[len - 1] == '/') { --len, --ret; } - while (ret && at_path[len - 1] != '/') { - --len, --ret; + if (errno != ENOTDIR) { + while (ret && at_path[len - 1] != '/') { + --len, --ret; + } } dstresize(&at_path, len); |