nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit a6a09338a2f990776795a312fece8df948fd3e16
parent df6dbbb84c55d824c459d44598fca3cb7633403f
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date:   Mon,  5 Apr 2021 21:02:07 +0530

Reformat UID/GID printing in statusbar

Diffstat:
Msrc/nnn.c | 17+++--------------
1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/src/nnn.c b/src/nnn.c @@ -5624,7 +5624,7 @@ static bool set_time_type(int *presel) static void statusbar(char *path) { int i = 0, extnlen = 0; - char *ptr, guidbuf[5]; + char *ptr; pEntry pent = &pdents[cur]; if (!ndents) { @@ -5687,20 +5687,9 @@ static void statusbar(char *path) struct passwd *pw = getpwuid(pent->uid); struct group *gr = getgrgid(pent->gid); - if (pw) - addstr(pw->pw_name); - else { - sprintf(guidbuf, "%d", pent->uid); - addstr(guidbuf); - } + addstr(pw ? pw->pw_name : xitoa(pent->uid)); addch(':'); - - if (gr) - addstr(gr->gr_name); - else { - sprintf(guidbuf, "%d", pent->gid); - addstr(guidbuf); - } + addstr(gr ? gr->gr_name : xitoa(pent->gid)); addch(' '); } #endif