Show correct symlink size in sttausbar

This commit is contained in:
Arun Prakash Jana 2021-03-21 06:25:17 +05:30
parent c625679d58
commit 71083b0670
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 8 additions and 3 deletions

View File

@ -5684,17 +5684,22 @@ static void statusbar(char *path)
addch(' ');
}
#endif
addstr(coolsize(pent->size));
addch(' ');
addstr(ptr);
if (S_ISLNK(pent->mode))
{
i = readlink(pent->name, g_buf, PATH_MAX);
if (i > 0)
addstr(coolsize(i));
if (i > 1) {
g_buf[i] = '\0';
addstr(" ->");
addstr(g_buf);
}
} else {
addstr(coolsize(pent->size));
addch(' ');
addstr(ptr);
}
addch('\n');
}