Add comments

This commit is contained in:
Arun Prakash Jana 2019-02-13 23:41:49 +05:30
parent 2ae5864147
commit cf0ea993df
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -1884,9 +1884,11 @@ static char *unescape(const char *str, uint maxcols)
if (maxcols) { if (maxcols) {
len = lencount = wcswidth(wbuf, len); len = lencount = wcswidth(wbuf, len);
/* Reduce nuber of wide chars to max columns */
if (len > maxcols) if (len > maxcols)
lencount = maxcols + 1; lencount = maxcols + 1;
/* Reduce wide chars one by one till it fits */
while (len > maxcols) while (len > maxcols)
len = wcswidth(wbuf, --lencount); len = wcswidth(wbuf, --lencount);