Skip to content

Commit 4f80c17

Browse files
committed
parse: Don't treat -mount differently from -xdev yet
The new POSIX version with -mount isn't out yet, so there's no point in conforming to a non-existent document while breaking compatibility with GNU find, which hasn't changed yet either. But a warning is added for the future incompatibility. This patch can be reverted to re-enable the feature.
1 parent 7b6bbf9 commit 4f80c17

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

parse.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,14 @@ static struct expr *parse_ls(struct parser_state *state, int arg1, int arg2) {
15431543
* Parse -mount.
15441544
*/
15451545
static struct expr *parse_mount(struct parser_state *state, int arg1, int arg2) {
1546-
state->cmdline->flags |= BFTW_MOUNT;
1546+
if (state->warn) {
1547+
parse_warning(state,
1548+
"In the future, %s will skip mount points entirely, unlike\n"
1549+
"-xdev, due to http://austingroupbugs.net/view.php?id=1133.\n\n",
1550+
state->argv[0]);
1551+
}
1552+
1553+
state->cmdline->flags |= BFTW_XDEV;
15471554
state->mount_arg = state->argv[0];
15481555
return parse_nullary_option(state);
15491556
}

tests/test_L_mount.out

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
scratch
22
scratch/foo
3+
scratch/mnt
4+
scratch/foo/bar
5+
scratch/foo/qux

tests/test_mount.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
scratch
22
scratch/foo
3+
scratch/mnt
34
scratch/foo/bar

0 commit comments

Comments
 (0)