From 74b4ba490f5dae2f5cd873596da4d91e70defd4f Mon Sep 17 00:00:00 2001 From: TAKAHASHI Tamotsu Date: Sat, 30 Jul 2005 04:40:45 +0000 Subject: [PATCH] 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) --- pager.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pager.c b/pager.c index c96178b5..898f380f 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... */ -- 2.50.1