Bernhard Voelker ba6be28896 find -printf %Y: handle ENOTDIR also as broken symlink
The above command should output 'N' (for broken symlinks) not only in
the ENOENT case, but also when an intermediate part of the symlink target
file name is a file (ENOTDIR):

  $ touch file
  $ ln -s file/ENOTDIR link
  $ find link -printf '%Y %p\n'
  N link

Previously, find output 'l' as for a resolvable symlink.

* find/print.c (do_fprintf): Treat ENOTDIR the same as ENOENT to detect
broken symlinks.
* find/testsuite/find.gnu/printf-symlink.exp: Extend the test, and ...
* find/testsuite/find.gnu/printf-symlink.xo: ... the expected output.
* NEWS (Bug fixes, #54262): Explicitly mention that both ENOENT and ENOTDIR
are used to detect broken symlinks.

Suggested by Tavian Barnes.
2018-07-24 08:37:52 +02:00
..
2016-02-16 23:27:44 +01:00
2018-03-14 20:44:14 +01:00
2018-06-23 23:54:42 +02:00