summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
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 543a98a..01da7a4 100644
--- a/eval.c
+++ b/eval.c
@@ -342,6 +342,18 @@ bool eval_quit(const struct expr *expr, struct eval_state *state) {
}
/**
+ * -samefile test.
+ */
+bool eval_samefile(const struct expr *expr, struct eval_state *state) {
+ const struct stat *statbuf = fill_statbuf(state);
+ if (!statbuf) {
+ return false;
+ }
+
+ return statbuf->st_dev == expr->dev && statbuf->st_ino == expr->ino;
+}
+
+/**
* -type test.
*/
bool eval_type(const struct expr *expr, struct eval_state *state) {