]> Sergey Matveev's repositories - nnn.git/commitdiff
Set attrs in a go
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 1 Mar 2020 06:49:17 +0000 (12:19 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 1 Mar 2020 06:49:17 +0000 (12:19 +0530)
src/nnn.c

index ea6b55421f7e9fc5b1de442155f3ced31d5e4318..0d9ad8a2d47062aafc7de5591099dceddc6916a2 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3196,10 +3196,7 @@ static void print_time(const time_t *timep)
 static void printent(const struct entry *ent, uint namecols, bool sel)
 {
        char ind = get_ind(ent->mode, FALSE);
-       int attrs = sel ? A_REVERSE : 0;
-
-       if (ind == '@' || (ent->flags & HARD_LINK))
-               attrs |= A_DIM;
+       int attrs = ((ind == '@' || (ent->flags & HARD_LINK)) ? A_DIM : 0) | (sel ? A_REVERSE : 0);
 
        if (!ind)
                ++namecols;