ソースを参照

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;
}


読み込み中…
キャンセル
保存