aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-02-12 21:12:34 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-02-12 21:20:30 +0530
commit2ae58641473d5bf4ecf0720b5272bf43ad0451ef (patch)
tree3943f4d20d3cf2f529935c320cdfa36eec546551 /src
parentd8d4be6aa610036dec8dfedcfb5a1d8fa4682043 (diff)
downloadnnn-2ae58641473d5bf4ecf0720b5272bf43ad0451ef.tar.gz
Fix file name generation
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);