summaryrefslogtreecommitdiffstats
path: root/color.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-07-29 22:44:53 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-07-29 22:53:27 -0400
commitf7b03c0695b313a0ddd527d4bbd6c50c010bd7e4 (patch)
tree667ae9a0b75cf6d1cf5503f9e9e9dd8d866a826a /color.c
parent5590685c30b7af5441938938db68a66e42820507 (diff)
downloadbfs-f7b03c0695b313a0ddd527d4bbd6c50c010bd7e4.tar.xz
bftw: Rename bftw_typeflag to bftw_type, and make it not a bitmask
Diffstat (limited to 'color.c')
-rw-r--r--color.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/color.c b/color.c
index cfb3f47..11684ef 100644
--- a/color.c
+++ b/color.c
@@ -557,15 +557,15 @@ static bool is_link_broken(const struct BFTW *ftwbuf) {
/** Get the color for a file. */
static const char *file_color(const struct colors *colors, const char *filename, const struct BFTW *ftwbuf, enum bfs_stat_flag flags) {
- enum bftw_typeflag typeflag = bftw_typeflag(ftwbuf, flags);
- if (typeflag == BFTW_ERROR) {
+ enum bftw_type type = bftw_type(ftwbuf, flags);
+ if (type == BFTW_ERROR) {
goto error;
}
const struct bfs_stat *statbuf = NULL;
const char *color = NULL;
- switch (typeflag) {
+ switch (type) {
case BFTW_REG:
if (colors->setuid || colors->setgid || colors->executable || colors->multi_hard) {
statbuf = bftw_stat(ftwbuf, flags);
@@ -719,7 +719,7 @@ static int print_colored(const struct colors *colors, const char *esc, const cha
static ssize_t first_broken_offset(const char *path, const struct BFTW *ftwbuf, enum bfs_stat_flag flags, size_t max) {
ssize_t ret = max;
- if (bftw_typeflag(ftwbuf, flags) != BFTW_ERROR) {
+ if (bftw_type(ftwbuf, flags) != BFTW_ERROR) {
goto out;
}
@@ -830,7 +830,7 @@ static int print_path(CFILE *cfile, const struct BFTW *ftwbuf) {
}
enum bfs_stat_flag flags = ftwbuf->stat_flags;
- if (colors && colors->link_as_target && ftwbuf->typeflag == BFTW_LNK) {
+ if (colors && colors->link_as_target && ftwbuf->type == BFTW_LNK) {
flags = BFS_STAT_TRYFOLLOW;
}