]> granicus.if.org Git - mutt/commitdiff
The builtin pager tries to wrap a line for ever
authorTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Sat, 30 Jul 2005 04:40:45 +0000 (04:40 +0000)
committerTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Sat, 30 Jul 2005 04:40:45 +0000 (04:40 +0000)
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)

pager.c

diff --git a/pager.c b/pager.c
index c96178b5f7f2fa2e3994721888991d65e441769e..898f380fc7e3037a5c7d75c8b9a4f175cb2134b8 100644 (file)
--- 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... */