From: TAKAHASHI Tamotsu Date: Sat, 30 Jul 2005 04:40:45 +0000 (+0000) Subject: The builtin pager tries to wrap a line for ever X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28eddeb07ca98167b277e9d8d651f018a9f0f934;p=neomutt The builtin pager tries to wrap a line for ever 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) --- diff --git a/pager.c b/pager.c index c96178b5f..898f380fc 100644 --- a/pager.c +++ b/pager.c @@ -1346,7 +1346,11 @@ display_line (FILE *f, long *last_pos, struct line_t **lineInfo, int n, /* 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... */