mirror of
https://github.com/jarun/nnn.git
synced 2025-01-24 09:46:38 +00:00
Simpler permission string generation
This commit is contained in:
parent
e83f4ca62f
commit
ace449c0e9
|
@ -2126,12 +2126,9 @@ static void printent_long(const struct entry *ent, int sel, uint namecols)
|
||||||
strftime(timebuf, 18, "%F %R", localtime(&ent->t));
|
strftime(timebuf, 18, "%F %R", localtime(&ent->t));
|
||||||
|
|
||||||
/* Permissions */
|
/* Permissions */
|
||||||
permbuf[0] = *xitoa((ent->mode >> 6) & 7);
|
permbuf[0] = '0' + ((ent->mode >> 6) & 7);
|
||||||
permbuf[0] = permbuf[0] ? permbuf[0] : '0';
|
permbuf[1] = '0' + ((ent->mode >> 3) & 7);
|
||||||
permbuf[1] = *xitoa((ent->mode >> 3) & 7);
|
permbuf[2] = '0' + (ent->mode & 7);
|
||||||
permbuf[1] = permbuf[1] ? permbuf[1] : '0';
|
|
||||||
permbuf[2] = *xitoa(ent->mode & 7);
|
|
||||||
permbuf[2] = permbuf[2] ? permbuf[2] : '0';
|
|
||||||
permbuf[3] = '\0';
|
permbuf[3] = '\0';
|
||||||
|
|
||||||
/* Trim escape chars from name */
|
/* Trim escape chars from name */
|
||||||
|
|
Loading…
Reference in a new issue