diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-05-17 00:34:50 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-05-22 08:48:44 +0530 |
commit | ace449c0e98b016ab6f8d7d1d83c0a60b4dd9bc6 (patch) | |
tree | c2a3a7bfdfb369a07c8376cc2210684c728b92e4 /src/nnn.c | |
parent | e83f4ca62f91aadf6c576f96a0ea1524edcc3851 (diff) | |
download | nnn-ace449c0e98b016ab6f8d7d1d83c0a60b4dd9bc6.tar.gz |
Simpler permission string generation
Diffstat (limited to 'src/nnn.c')
-rw-r--r-- | src/nnn.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -2126,12 +2126,9 @@ static void printent_long(const struct entry *ent, int sel, uint namecols) strftime(timebuf, 18, "%F %R", localtime(&ent->t)); /* Permissions */ - permbuf[0] = *xitoa((ent->mode >> 6) & 7); - permbuf[0] = permbuf[0] ? permbuf[0] : '0'; - permbuf[1] = *xitoa((ent->mode >> 3) & 7); - permbuf[1] = permbuf[1] ? permbuf[1] : '0'; - permbuf[2] = *xitoa(ent->mode & 7); - permbuf[2] = permbuf[2] ? permbuf[2] : '0'; + permbuf[0] = '0' + ((ent->mode >> 6) & 7); + permbuf[1] = '0' + ((ent->mode >> 3) & 7); + permbuf[2] = '0' + (ent->mode & 7); permbuf[3] = '\0'; /* Trim escape chars from name */ |