Skip to content

Commit

Permalink
parse: Fix crash on -xdev -mount
Browse files Browse the repository at this point in the history
  • Loading branch information
tavianator committed Nov 30, 2022
1 parent 33a6a30 commit c55e855
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1802,7 +1802,7 @@ static struct bfs_expr *parse_mount(struct parser_state *state, int arg1, int ar
bfs_warning(state->ctx, "${blu}-xdev${rs}, due to http://austingroupbugs.net/view.php?id=1133.\n\n");

state->ctx->flags |= BFTW_PRUNE_MOUNTS;
state->mount_arg = state->argv;
state->mount_arg = expr->argv;
return expr;
}

Expand Down
19 changes: 19 additions & 0 deletions tests/bfs/warn_xdev_mount.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
basic
basic/a
basic/b
basic/c
basic/c/d
basic/e
basic/e/f
basic/g
basic/g/h
basic/i
basic/j
basic/j/foo
basic/k
basic/k/foo
basic/k/foo/bar
basic/l
basic/l/foo
basic/l/foo/bar
basic/l/foo/bar/baz
2 changes: 2 additions & 0 deletions tests/bfs/warn_xdev_mount.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Regression test: don't crash if -mount is the last option
bfs_diff basic -warn -xdev -mount

0 comments on commit c55e855

Please sign in to comment.