aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 52487a8..f59c071 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1884,6 +1884,9 @@ static char *unescape(const char *str, uint maxcols)
if (maxcols) {
len = lencount = wcswidth(wbuf, len);
+ if (len > maxcols)
+ lencount = maxcols + 1;
+
while (len > maxcols)
len = wcswidth(wbuf, --lencount);