summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-08-13 10:02:29 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-08-13 10:14:29 -0400
commit564142a029fda86b2d87f8f39c12acea34241098 (patch)
tree802a8225cacfc1d9f8ba80c0959651353f728325 /eval.c
parent6a4c2677075adca143fa8501096a2a59499503b5 (diff)
downloadbfs-564142a029fda86b2d87f8f39c12acea34241098.tar.xz
Implement -xattrname
From macOS find.
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 dc859b7..f8b9a6d 100644
--- a/eval.c
+++ b/eval.c
@@ -864,6 +864,19 @@ bool eval_xattr(const struct expr *expr, struct eval_state *state) {
}
/**
+ * -xattr test.
+ */
+bool eval_xattrname(const struct expr *expr, struct eval_state *state) {
+ int ret = bfs_check_xattr_named(state->ftwbuf, expr->sdata);
+ 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) {