find: fix dangling symlink behavior.

ENOENT is ignored, but other errors are reported.
diff --git a/lib/dirtree.c b/lib/dirtree.c
index c5cf654..e44df66 100644
--- a/lib/dirtree.c
+++ b/lib/dirtree.c
@@ -36,7 +36,7 @@
     int fd = parent ? parent->dirfd : AT_FDCWD;
 
     if (fstatat(fd, name, &st,AT_SYMLINK_NOFOLLOW*!(flags&DIRTREE_SYMFOLLOW))) {
-      if (flags&DIRTREE_STATLESS) statless++;
+      if ((flags&DIRTREE_STATLESS) && errno == ENOENT) statless++;
       else goto error;
     }
     if (S_ISLNK(st.st_mode)) {
diff --git a/tests/find.test b/tests/find.test
index ab84fb0..cbca8e7 100755
--- a/tests/find.test
+++ b/tests/find.test
@@ -104,6 +104,10 @@
   "file dir/file file 0" "" ""
 testing "-printf .N" "find dir -name file -printf %.2f" "fi" "" ""
 
+ln -s does-not-exist dir/dangler
+ln -s looper dir/looper
+testing "-L dangling link" "LANG=C find -L dir -name file 2>&1 | sed s/\'//g" \
+  "dir/file\nfind: dir/looper: Too many levels of symbolic links\n" "" ""
 
 testing "-false" "find dir -false" "" "" ""
 testing "-true" "find dir/file -true" "dir/file\n" "" ""
diff --git a/toys/posix/find.c b/toys/posix/find.c
index 5fc9b0c..782cc3b 100644
--- a/toys/posix/find.c
+++ b/toys/posix/find.c
@@ -211,7 +211,8 @@
   struct double_list *argdata = TT.argdata;
   char *s, **ss;
 
-  recurse = DIRTREE_COMEAGAIN|(DIRTREE_SYMFOLLOW*!!(toys.optflags&FLAG_L));
+  recurse = DIRTREE_STATLESS|DIRTREE_COMEAGAIN|
+    (DIRTREE_SYMFOLLOW*!!(toys.optflags&FLAG_L));
 
   // skip . and .. below topdir, handle -xdev and -depth
   if (new) {
@@ -669,7 +670,8 @@
 
   // Loop through paths
   for (i = 0; i < len; i++)
-    dirtree_flagread(ss[i], DIRTREE_SYMFOLLOW*!!(toys.optflags&(FLAG_H|FLAG_L)),
+    dirtree_flagread(ss[i],
+      DIRTREE_STATLESS|(DIRTREE_SYMFOLLOW*!!(toys.optflags&(FLAG_H|FLAG_L))),
       do_find);
 
   execdir(0, 1);