Reformat UID/GID printing in statusbar

This commit is contained in:
Arun Prakash Jana 2021-04-05 21:02:07 +05:30
parent df6dbbb84c
commit a6a09338a2
1 changed files with 3 additions and 14 deletions

View File

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