浏览代码

Simpler symlink to dir check

master
Arun Prakash Jana 5 年前
父节点
当前提交
26861532a2
找不到此签名对应的密钥 GPG 密钥 ID: A75979F35C080412
共有 1 个文件被更改,包括 7 次插入11 次删除
  1. +7
    -11
      src/nnn.c

+ 7
- 11
src/nnn.c 查看文件

@@ -2676,19 +2676,15 @@ static int dentfill(char *path, struct entry **dents)
}

/* Flag if this is a dir or symlink to a dir */
if (S_ISLNK(sb.st_mode)) {
sb.st_mode = 0;
fstatat(fd, namep, &sb, 0);
}

if (S_ISDIR(sb.st_mode))
dentp->flags |= DIR_OR_LINK_TO_DIR;
else if (!S_ISLNK(sb.st_mode)) {
if (dentp->flags & DIR_OR_LINK_TO_DIR)
dentp->flags &= ~DIR_OR_LINK_TO_DIR;
} else {
if (!fstatat(fd, namep, &sb, 0)) {
if (S_ISDIR(sb.st_mode))
dentp->flags |= DIR_OR_LINK_TO_DIR;
else
dentp->flags &= ~DIR_OR_LINK_TO_DIR;
}
}
else if (dentp->flags & DIR_OR_LINK_TO_DIR)
dentp->flags &= ~DIR_OR_LINK_TO_DIR;

++n;
}


正在加载...
取消
保存