diff options
| author | 2019-08-13 04:22:34 +0530 | |
|---|---|---|
| committer | 2019-08-13 04:22:34 +0530 | |
| commit | 5ea8dee42889322c2f70b88fb30713ad671cf46a (patch) | |
| tree | 7dcb8977a3b5a0293ac3b737b87715087c8e8e57 | |
| parent | 0cf77c2ac69aadf7e4ed38061f4c428b231b8d46 (diff) | |
| download | nnn-5ea8dee42889322c2f70b88fb30713ad671cf46a.tar.gz | |
List symlink with target missing
| -rw-r--r-- | src/nnn.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -3004,8 +3004,18 @@ static int dentfill(char *path, struct entry **dents) } if (fstatat(fd, namep, &sb, flags) == -1) { - DPRINTF_S(namep); - continue; + /* List a symlink with target missing */ + if (!flags && errno == ENOENT) { + if (fstatat(fd, namep, &sb, AT_SYMLINK_NOFOLLOW) == -1) { + DPRINTF_S(namep); + DPRINTF_S(strerror(errno)); + continue; + } + } else { + DPRINTF_S(namep); + DPRINTF_S(strerror(errno)); + continue; + } } if (n == total_dents) { |