From: Arun Prakash Jana Date: Sun, 21 Mar 2021 00:55:17 +0000 (+0530) Subject: Show correct symlink size in sttausbar X-Git-Tag: v3.7~62 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=71083b0670d62a05e86c9355fb78945b84f595f5;p=nnn.git Show correct symlink size in sttausbar --- diff --git a/src/nnn.c b/src/nnn.c index c13b6ab8..a6cb7d2a 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -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'); }