From f7b03c0695b313a0ddd527d4bbd6c50c010bd7e4 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 29 Jul 2020 22:44:53 -0400 Subject: bftw: Rename bftw_typeflag to bftw_type, and make it not a bitmask --- color.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'color.c') 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; } -- cgit v1.2.3