mirror of
https://github.com/jarun/nnn.git
synced 2024-09-29 09:17:51 +00:00
Fix garbled symlink target
This commit is contained in:
parent
5f0b3b74d0
commit
4c8e2e25b8
|
@ -5687,12 +5687,16 @@ static void statusbar(char *path)
|
||||||
addstr(coolsize(pent->size));
|
addstr(coolsize(pent->size));
|
||||||
addch(' ');
|
addch(' ');
|
||||||
addstr(ptr);
|
addstr(ptr);
|
||||||
if (S_ISLNK(pent->mode) && (readlink(pent->name, g_buf, PATH_MAX) > 0))
|
if (S_ISLNK(pent->mode))
|
||||||
{
|
{
|
||||||
|
i = readlink(pent->name, g_buf, PATH_MAX);
|
||||||
|
if (i > 1) {
|
||||||
|
g_buf[i] = '\0';
|
||||||
addstr(" [-> ");
|
addstr(" [-> ");
|
||||||
addstr(g_buf);
|
addstr(g_buf);
|
||||||
addch(']');
|
addch(']');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
addch('\n');
|
addch('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue