summaryrefslogtreecommitdiffstats
path: root/color.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-05-23 17:11:23 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-05-24 09:00:50 -0400
commitd9b3196d6c8f4fa0e7d0a4771040762edaebb1ee (patch)
treef378d6955cf3cd6817a47e3a95284441552b221e /color.c
parent28bbaeac8058653a4a46ae439c37d251a550f4f9 (diff)
downloadbfs-d9b3196d6c8f4fa0e7d0a4771040762edaebb1ee.tar.xz
fsade: Refactor the POSIX.1e abstractions
Since we're going to want to abstract more things that aren't part of POSIX.1e (like xattrs) in a similar way, let's give this a more generic name. And while we're at it, give it some more precise error reporting, and add some tests.
Diffstat (limited to 'color.c')
-rw-r--r--color.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/color.c b/color.c
index fd9949e..aefc3ff 100644
--- a/color.c
+++ b/color.c
@@ -17,7 +17,7 @@
#include "color.h"
#include "bftw.h"
#include "dstring.h"
-#include "posix1e.h"
+#include "fsade.h"
#include "stat.h"
#include "trie.h"
#include "util.h"
@@ -572,7 +572,7 @@ static const char *file_color(const struct colors *colors, const char *filename,
color = colors->setuid;
} else if (colors->setgid && (statbuf->mode & 02000)) {
color = colors->setgid;
- } else if (colors->capable && bfs_check_capabilities(ftwbuf)) {
+ } else if (colors->capable && bfs_check_capabilities(ftwbuf) > 0) {
color = colors->capable;
} else if (colors->executable && (statbuf->mode & 00111)) {
color = colors->executable;