From 43b7d485d2ab9e320fd32fc47080cd60c626b530 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 4 Feb 2016 17:25:04 -0500 Subject: Implement -links. --- eval.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'eval.c') diff --git a/eval.c b/eval.c index a60bd30..543a98a 100644 --- a/eval.c +++ b/eval.c @@ -284,6 +284,18 @@ bool eval_inum(const struct expr *expr, struct eval_state *state) { return do_cmp(expr, statbuf->st_ino); } +/** + * -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. */ -- cgit v1.2.3