From 4f80c17192f2b28c96a489969d4435151d68d0ce Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 11 Sep 2019 22:55:54 -0400 Subject: 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. --- parse.c | 9 ++++++++- tests/test_L_mount.out | 3 +++ tests/test_mount.out | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/parse.c b/parse.c index b0b8167..0ea40c5 100644 --- a/parse.c +++ b/parse.c @@ -1543,7 +1543,14 @@ static struct expr *parse_ls(struct parser_state *state, int arg1, int arg2) { * Parse -mount. */ static struct expr *parse_mount(struct parser_state *state, int arg1, int arg2) { - state->cmdline->flags |= BFTW_MOUNT; + if (state->warn) { + parse_warning(state, + "In the future, %s will skip mount points entirely, unlike\n" + "-xdev, due to http://austingroupbugs.net/view.php?id=1133.\n\n", + state->argv[0]); + } + + state->cmdline->flags |= BFTW_XDEV; state->mount_arg = state->argv[0]; return parse_nullary_option(state); } diff --git a/tests/test_L_mount.out b/tests/test_L_mount.out index ed0e9a1..2c3c590 100644 --- a/tests/test_L_mount.out +++ b/tests/test_L_mount.out @@ -1,2 +1,5 @@ scratch scratch/foo +scratch/mnt +scratch/foo/bar +scratch/foo/qux diff --git a/tests/test_mount.out b/tests/test_mount.out index 2425675..005bdcf 100644 --- a/tests/test_mount.out +++ b/tests/test_mount.out @@ -1,3 +1,4 @@ scratch scratch/foo +scratch/mnt scratch/foo/bar -- cgit v1.2.3