apply: do not get confused by symlinks in the middle