summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-05-23 17:13:39 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-05-24 09:00:51 -0400
commitf1fb3158d3f242f1884d8d8a7473ab0719e93e8c (patch)
tree4ab193109db3da98b779ed807f40adb3bb0b9fbd /eval.c
parentd9b3196d6c8f4fa0e7d0a4771040762edaebb1ee (diff)
downloadbfs-f1fb3158d3f242f1884d8d8a7473ab0719e93e8c.tar.xz
Implement -xattr predicate
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index f07b380..bd69b67 100644
--- a/eval.c
+++ b/eval.c
@@ -887,6 +887,19 @@ bool eval_type(const struct expr *expr, struct eval_state *state) {
}
/**
+ * -xattr test.
+ */
+bool eval_xattr(const struct expr *expr, struct eval_state *state) {
+ int ret = bfs_check_xattrs(state->ftwbuf);
+ if (ret >= 0) {
+ return ret;
+ } else {
+ eval_report_error(state);
+ return false;
+ }
+}
+
+/**
* -xtype test.
*/
bool eval_xtype(const struct expr *expr, struct eval_state *state) {