Simpler permission string generation

This commit is contained in:
Arun Prakash Jana 2019-05-17 00:34:50 +05:30
parent e83f4ca62f
commit ace449c0e9
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 3 additions and 6 deletions

View File

@ -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 */