aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-02-26 08:53:40 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-02-26 08:54:34 +0530
commit7aa72ddd7960aa7962d52e83052b85b770964227 (patch)
tree1d6b7d21c7e50f46b420567457ada81cfe69a6a9
parent07437a897cf3e0921202b4c05da7aa23b486d8c3 (diff)
downloadnnn-7aa72ddd7960aa7962d52e83052b85b770964227.tar.gz
Optimize print entry
-rw-r--r--src/nnn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index b44755c..3e161db 100644
--- 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);