]> Sergey Matveev's repositories - nnn.git/commitdiff
Optimize print entry
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 26 Feb 2020 03:23:40 +0000 (08:53 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 26 Feb 2020 03:24:34 +0000 (08:54 +0530)
src/nnn.c

index b44755c5075b2845fae31ecb08f03b011b139d40..3e161db89b630815f307896dbed0bfb876ad607d 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3172,13 +3172,15 @@ static void printent(const struct entry *ent, uint namecols, bool sel)
 
 static void printent_long(const struct entry *ent, uint namecols, bool sel)
 {
-       char timebuf[18], permbuf[8] = "      ", ind1 = '\0', ind2 = '\0', special = '\0';
+       char timebuf[18], permbuf[8], ind1 = '\0', ind2 = '\0', special = '\0';
 
        /* Timestamp */
        strftime(timebuf, sizeof(timebuf), "%F %R", localtime(&ent->t));
        //timebuf[sizeof(timebuf)-1] = '\0';
 
        /* Permissions */
+       permbuf[0] = permbuf[1] = permbuf[5] = ' ';
+       permbuf[6] = '\0';
        permbuf[2] = '0' + ((ent->mode >> 6) & 7);
        permbuf[3] = '0' + ((ent->mode >> 3) & 7);
        permbuf[4] = '0' + (ent->mode & 7);