summaryrefslogtreecommitdiffstats
path: root/src/opt.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-07-17 15:58:37 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-07-17 16:00:54 -0400
commit812d3efed33e1b04d3f5c661a2bd4c7b8ecaf09d (patch)
treef10adb6de7b913d930eda3cdd647df48c8297f71 /src/opt.c
parentd9f7bf31d0693b81bddb7e8c57118dd7f78a2952 (diff)
downloadbfs-812d3efed33e1b04d3f5c661a2bd4c7b8ecaf09d.tar.xz
opt: -lname implies -type l
Diffstat (limited to 'src/opt.c')
-rw-r--r--src/opt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/opt.c b/src/opt.c
index 9b091bd..1c8670c 100644
--- a/src/opt.c
+++ b/src/opt.c
@@ -1673,6 +1673,12 @@ static struct bfs_expr *data_flow_links(struct bfs_opt *opt, struct bfs_expr *ex
return expr;
}
+/** Transfer function for -lname. */
+static struct bfs_expr *data_flow_lname(struct bfs_opt *opt, struct bfs_expr *expr, const struct visitor *visitor) {
+ opt->after_true.types &= 1 << BFS_LNK;
+ return expr;
+}
+
/** Transfer function for -samefile. */
static struct bfs_expr *data_flow_samefile(struct bfs_opt *opt, struct bfs_expr *expr, const struct visitor *visitor) {
struct df_range *true_range = &opt->after_true.ranges[INUM_RANGE];
@@ -1863,6 +1869,7 @@ static const struct visitor data_flow = {
{eval_gid, data_flow_gid},
{eval_inum, data_flow_inum},
{eval_links, data_flow_links},
+ {eval_lname, data_flow_lname},
{eval_samefile, data_flow_samefile},
{eval_size, data_flow_size},
{eval_type, data_flow_type},