projects
/
nnn.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f0b3b7
)
Fix garbled symlink target
author
Arun Prakash Jana <engineerarun@gmail.com>
Thu, 18 Mar 2021 18:57:45 +0000 (
00:27
+0530)
committer
Arun Prakash Jana <engineerarun@gmail.com>
Thu, 18 Mar 2021 18:57:45 +0000 (
00:27
+0530)
src/nnn.c
patch
|
blob
|
history
diff --git
a/src/nnn.c
b/src/nnn.c
index 8ad255bc284d8d78c5ced529fa689aa5536fb521..c7cc682d499a6a39e35ec54e4edd90d42e65fc23 100644
(file)
--- a/
src/nnn.c
+++ b/
src/nnn.c
@@
-5687,11
+5687,15
@@
static void statusbar(char *path)
addstr(coolsize(pent->size));
addch(' ');
addstr(ptr);
- if (S_ISLNK(pent->mode)
&& (readlink(pent->name, g_buf, PATH_MAX) > 0)
)
+ if (S_ISLNK(pent->mode))
{
- addstr(" [-> ");
- addstr(g_buf);
- addch(']');
+ i = readlink(pent->name, g_buf, PATH_MAX);
+ if (i > 1) {
+ g_buf[i] = '\0';
+ addstr(" [-> ");
+ addstr(g_buf);
+ addch(']');
+ }
}
addch('\n');
}