fix for "find / /boot -xdev"

Paul Fox pgf at brightstareng.com
Wed Sep 5 11:48:04 PDT 2007


currently,
    busybox find / /boot -xdev
gives no output at all, rather than giving equivalent of 
    find / -xdev; find /boot -xdev

the bug was introduced (by me :-/ ) in r14665.

i'll commit this patch tomorrow if no objections.

paul

Index: findutils/find.c
===================================================================
--- findutils/find.c	(revision 19794)
+++ findutils/find.c	(working copy)
@@ -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);


=---------------------
 paul fox, pgf at brightstareng.com


More information about the busybox mailing list