Skip to content

Commit

Permalink
Minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed Apr 13, 2021
1 parent ee04215 commit 0c55e74
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/nnn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3715,20 +3715,18 @@ static void printent(const struct entry *ent, uint_t namecols, bool sel)
static void print_details(const struct entry *ent)
{
int entry_type = ent->mode & S_IFMT;
char perms[6] = {' ', ' ', (char)('0' + ((ent->mode >> 6) & 7)),
(char)('0' + ((ent->mode >> 3) & 7)), (char)('0' + (ent->mode & 7)), '\0'};

/* Directories are always shown on top */
resetdircolor(ent->flags);

print_time(&ent->t);
addstr(" ");

/* Permissions */
addch('0' + ((ent->mode >> 6) & 7));
addch('0' + ((ent->mode >> 3) & 7));
addch('0' + (ent->mode & 7));
addstr(perms);

if (entry_type == S_IFREG || entry_type == S_IFDIR) {
char *size = coolsize(cfg.blkorder ? ent->blocks << blk_shift : ent->size);

printw("%*c%s", 9 - (uint_t)xstrlen(size), ' ', size);
} else
printw("%*c%c", 8, ' ', get_detail_ind(ent->mode));
Expand Down

0 comments on commit 0c55e74

Please sign in to comment.