summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2016-02-04 17:25:04 -0500
committerTavian Barnes <tavianator@tavianator.com>2016-02-04 17:25:04 -0500
commit43b7d485d2ab9e320fd32fc47080cd60c626b530 (patch)
tree0216c757761c1ea91661119a6c80613ed43705e4 /eval.c
parentff87f3cdf1e3c5a7d4661e785f4d96be9d59291c (diff)
downloadbfs-43b7d485d2ab9e320fd32fc47080cd60c626b530.tar.xz
Implement -links.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index a60bd30..543a98a 100644
--- a/eval.c
+++ b/eval.c
@@ -285,6 +285,18 @@ bool eval_inum(const struct expr *expr, struct eval_state *state) {
}
/**
+ * -links test.
+ */
+bool eval_links(const struct expr *expr, struct eval_state *state) {
+ const struct stat *statbuf = fill_statbuf(state);
+ if (!statbuf) {
+ return false;
+ }
+
+ return do_cmp(expr, statbuf->st_nlink);
+}
+
+/**
* -name test.
*/
bool eval_name(const struct expr *expr, struct eval_state *state) {