src/nnn.c | 8 ++++---- diff --git a/src/nnn.c b/src/nnn.c index 23dbb345bc54b2a17a9f3756bf3c10e7effa8baf..e32a0d95d132d6a6185d9b8d1ebee618c87a4e2f 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -1722,9 +1722,9 @@ DPRINTF_S("Invalid key"); return NULL; } -static void resetdircolor(mode_t mode) +static void resetdircolor(int flags) { - if (cfg.dircolor && !S_ISDIR(mode)) { + if (cfg.dircolor && !(flags & DIR_OR_LINK_TO_DIR)) { attroff(COLOR_PAIR(cfg.curctx + 1) | A_BOLD); cfg.dircolor = 0; } @@ -1872,7 +1872,7 @@ pname = unescape(ent->name, namecols); /* Directories are always shown on top */ - resetdircolor(ent->mode); + resetdircolor(ent->flags); printw("%s%s%s\n", CURSYM(sel), pname, get_file_sym(ent->mode)); } @@ -1885,7 +1885,7 @@ strftime(buf, 18, "%F %R", localtime(&ent->t)); pname = unescape(ent->name, namecols); /* Directories are always shown on top */ - resetdircolor(ent->mode); + resetdircolor(ent->flags); if (sel) attron(A_REVERSE);