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

Show symlink even if target cannot be stat-ed

master
Arun Prakash Jana 5 роки тому
джерело
коміт
6fcc6834ff
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: A75979F35C080412
2 змінених файлів з 7 додано та 10 видалено
  1. +4
    -4
      src/dbg.h
  2. +3
    -6
      src/nnn.c

+ 4
- 4
src/dbg.h Переглянути файл

@@ -76,10 +76,10 @@ static void disabledbg(void)
close(DEBUG_FD);
}

#define DPRINTF_D(x) xprintf(DEBUG_FD, #x "=%d\n", x)
#define DPRINTF_U(x) xprintf(DEBUG_FD, #x "=%u\n", x)
#define DPRINTF_S(x) xprintf(DEBUG_FD, #x "=%s\n", x)
#define DPRINTF_P(x) xprintf(DEBUG_FD, #x "=%p\n", x)
#define DPRINTF_D(x) xprintf(DEBUG_FD, #x "=%d [ln %d]\n", x, __LINE__)
#define DPRINTF_U(x) xprintf(DEBUG_FD, #x "=%u [ln %d]\n", x, __LINE__)
#define DPRINTF_S(x) xprintf(DEBUG_FD, #x "=%s [ln %d]\n", x, __LINE__)
#define DPRINTF_P(x) xprintf(DEBUG_FD, #x "=%p [ln %d]\n", x, __LINE__)
#else
#define DPRINTF_D(x)
#define DPRINTF_U(x)


+ 3
- 6
src/nnn.c Переглянути файл

@@ -3756,15 +3756,12 @@ static int dentfill(char *path, struct entry **dents)

if (fstatat(fd, namep, &sb, flags) == -1) {
/* List a symlink with target missing */
if (!flags && errno == ENOENT) {
if (fstatat(fd, namep, &sb, AT_SYMLINK_NOFOLLOW) == -1) {
if (flags || (!flags && fstatat(fd, namep, &sb, AT_SYMLINK_NOFOLLOW) == -1)) {
DPRINTF_U(flags);
if (!flags) {
DPRINTF_S(namep);
DPRINTF_S(strerror(errno));
continue;
}
} else {
DPRINTF_S(namep);
DPRINTF_S(strerror(errno));
continue;
}
}


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