diff options
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -13,6 +13,7 @@ #include "bftw.h" #include "color.h" #include "dstring.h" +#include "mtab.h" #include "util.h" #include <assert.h> #include <dirent.h> @@ -367,6 +368,19 @@ done: } /** + * -fstype test. + */ +bool eval_fstype(const struct expr *expr, struct eval_state *state) { + const struct stat *statbuf = fill_statbuf(state); + if (!statbuf) { + return false; + } + + const char *type = bfs_fstype(state->cmdline->mtab, statbuf); + return strcmp(type, expr->sdata) == 0; +} + +/** * -hidden test. */ bool eval_hidden(const struct expr *expr, struct eval_state *state) { |