From: Rocco Rutte Date: Thu, 1 Nov 2007 20:21:33 +0000 (+0100) Subject: Unbreak exact address feature. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31eba85939b0489c4f70a49f9198c622a175ef35;p=neomutt Unbreak exact address feature. The problem was that when reading back tempfiles for pager display, trailing \n were not removed from the input so the pager displayed 2 instead of 1. --- diff --git a/INSTALL b/INSTALL index 3d6a3a227..d9d96a7d1 100644 --- a/INSTALL +++ b/INSTALL @@ -193,9 +193,6 @@ to ``configure'' to help it out, or change the default behavior: addresses in the same form they are parsed. NOTE: this requires significantly more memory. - WARNING: DO NOT USE THIS OPTION, IT IS BROKEN. - - Once ``configure'' has completed, simply type ``make install.'' Mutt should compile cleanly (without errors) and you should end up with a diff --git a/UPDATING b/UPDATING index 877e0ef79..eb9d05ed1 100644 --- a/UPDATING +++ b/UPDATING @@ -4,6 +4,7 @@ mutt. Please read this file carefully when upgrading your installation. The keys used are: !: modified feature, -: deleted feature, +: new feature + ! --enable-exact-address works again + next-unread-mailbox + $message_cache_clean (clean cache on sync) + %P expando for $pager_format diff --git a/rfc822.c b/rfc822.c index 7b05e3039..4500e67da 100644 --- a/rfc822.c +++ b/rfc822.c @@ -337,7 +337,7 @@ add_addrspec (ADDRESS **top, ADDRESS **last, const char *phrase, ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s) { - int ws_pending; + int ws_pending, nl; const char *begin, *ps; char comment[STRING], phrase[STRING]; size_t phraselen = 0, commentlen = 0; @@ -350,6 +350,8 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s) last = last->next; ws_pending = isspace ((unsigned char) *s); + if ((nl = mutt_strlen (s))) + nl = s[nl - 1] == '\n'; SKIPWS (s); begin = s; @@ -500,7 +502,7 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s) } #ifdef EXACT_ADDRESS if (last) - last->val = mutt_substrdup (begin, s); + last->val = mutt_substrdup (begin, s - nl < begin ? begin : s - nl); #endif return top;