]> Sergey Matveev's repositories - nnn.git/commitdiff
Pass mode directly for indicator
authorArun Prakash Jana <engineerarun@gmail.com>
Mon, 5 Apr 2021 18:49:32 +0000 (00:19 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Mon, 5 Apr 2021 18:49:32 +0000 (00:19 +0530)
src/nnn.c

index 73f1acab711d9becc31e997ab8ff82fdcf3c06a9..66c3e058de37f4245f53ebe01a069ce264c92e00 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3598,9 +3598,9 @@ static void print_time(const time_t *timep)
               t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min);
 }
 
-static char get_detail_ind(const struct entry *ent)
+static char get_detail_ind(const mode_t mode)
 {
-       switch (ent->mode & S_IFMT) {
+       switch (mode & S_IFMT) {
        case S_IFDIR:  // fallthrough
        case S_IFREG:  return ' ';
        case S_IFLNK:  return '@';
@@ -3737,7 +3737,7 @@ static void print_details(const struct entry *ent)
                addstr(size);
        } else {
                addstr("        ");
-               addch(get_detail_ind(ent));
+               addch(get_detail_ind(ent->mode));
        }
 }