fix -xdev behavior in the presence of two or more nested mount points
on the command line, e.g. "find / /boot -xdev".
diff --git a/findutils/find.c b/findutils/find.c
index 2158468..f3167a0 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -383,9 +383,11 @@
#if ENABLE_FEATURE_FIND_XDEV
if (S_ISDIR(statbuf->st_mode) && xdev_count) {
for (i = 0; i < xdev_count; i++) {
- if (xdev_dev[i] != statbuf->st_dev)
- return SKIP;
+ if (xdev_dev[i] == statbuf->st_dev)
+ break;
}
+ if (i == xdev_count)
+ return SKIP;
}
#endif
i = exec_actions(actions, fileName, statbuf);