Переглянути джерело

Simpler symlink to dir check

master
Arun Prakash Jana 5 роки тому
джерело
коміт
26861532a2
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: 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;
}


Завантаження…
Відмінити
Зберегти