Skip to content

Commit c55e855

Browse files
committed
parse: Fix crash on -xdev -mount
1 parent 33a6a30 commit c55e855

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

src/parse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1802,7 +1802,7 @@ static struct bfs_expr *parse_mount(struct parser_state *state, int arg1, int ar
18021802
bfs_warning(state->ctx, "${blu}-xdev${rs}, due to http://austingroupbugs.net/view.php?id=1133.\n\n");
18031803

18041804
state->ctx->flags |= BFTW_PRUNE_MOUNTS;
1805-
state->mount_arg = state->argv;
1805+
state->mount_arg = expr->argv;
18061806
return expr;
18071807
}
18081808

tests/bfs/warn_xdev_mount.out

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
basic
2+
basic/a
3+
basic/b
4+
basic/c
5+
basic/c/d
6+
basic/e
7+
basic/e/f
8+
basic/g
9+
basic/g/h
10+
basic/i
11+
basic/j
12+
basic/j/foo
13+
basic/k
14+
basic/k/foo
15+
basic/k/foo/bar
16+
basic/l
17+
basic/l/foo
18+
basic/l/foo/bar
19+
basic/l/foo/bar/baz

tests/bfs/warn_xdev_mount.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Regression test: don't crash if -mount is the last option
2+
bfs_diff basic -warn -xdev -mount

0 commit comments

Comments
 (0)