From 80b42294f3f8a9d729dd3a851299ce688ca8f774 Mon Sep 17 00:00:00 2001 From: Rocco Rutte Date: Fri, 17 Apr 2009 13:20:04 +0200 Subject: [PATCH] Don't consider \n part of a line for body coloring. Closes #2363. --- ChangeLog | 12 ++++++++++++ pager.c | 10 +++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 80af26cb8..83ba9eda7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-04-17 12:47 +0200 Rocco Rutte (85414f890777) + + * attach.c: Enlarge buffer size for parsing mailcap files + + We really need code for dynamic buffers which would solve a few + other bugs, too. Closes #2205. + +2009-04-16 19:23 +0200 Rocco Rutte (a4f66ae72dc5) + + * ChangeLog, pop_lib.c: POP: Default to using getservbyname() as we do + for IMAP and SMTP + 2009-04-16 19:14 +0200 Rocco Rutte (ca73c9e8c141) * doc/manual.xml.head: Manual: Improve docs on URL syntax, add diff --git a/pager.c b/pager.c index 38f2e9e5b..7c3f19420 100644 --- a/pager.c +++ b/pager.c @@ -812,8 +812,14 @@ resolve_types (char *buf, char *raw, struct line_t *lineInfo, int n, int last, if (lineInfo[n].type == MT_COLOR_NORMAL || lineInfo[n].type == MT_COLOR_QUOTED) { - i = 0; + size_t nl; + + /* don't consider line endings part of the buffer + * for regex matching */ + if ((nl = mutt_strlen (buf)) > 0 && buf[nl-1] == '\n') + buf[nl-1] = 0; + i = 0; offset = 0; lineInfo[n].chunks = 0; do @@ -863,6 +869,8 @@ resolve_types (char *buf, char *raw, struct line_t *lineInfo, int n, int last, else offset = (lineInfo[n].syntax)[i].last; } while (found || null_rx); + if (nl > 0) + buf[nl] = '\n'; } } -- 2.40.0