if:
0) the line contains a space or a tab character
followed by a very long word, and
1) M_PAGER_NSKIP flag is passed to it, and
2) $smart_wrap is set. (default)
/* skip trailing blanks */
while (ch && (buf[ch] == ' ' || buf[ch] == '\t' || buf[ch] == '\r'))
ch--;
- cnt = ch + 1;
+ /* a very long word with leading spaces causes infinite wrapping */
+ if ((!ch) && (flags & M_PAGER_NSKIP))
+ buf_ptr = buf + cnt;
+ else
+ cnt = ch + 1;
}
else
buf_ptr = buf + cnt; /* a very long word... */