From: Arun Prakash Jana Date: Mon, 12 Aug 2019 22:52:34 +0000 (+0530) Subject: List symlink with target missing X-Git-Tag: v2.7~149 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=5ea8dee42889322c2f70b88fb30713ad671cf46a;p=nnn.git List symlink with target missing --- diff --git a/src/nnn.c b/src/nnn.c index f0623f32..017ebe3e 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -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) {