Commit e6b9b97e authored by Thomas Roessler's avatar Thomas Roessler

Change the default format to be more friendly to "0-line messages",

and fix optional expansion for %l - it was the wrong way around.
Also, add a hack to parse.c so we ignore negative values in Lines
headers.
parent 8b5ee99b
......@@ -449,11 +449,8 @@ hdr_format_str (char *dest,
snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
snprintf (dest, destlen, fmt, (int) hdr->lines);
}
else
{
if (hdr->lines > 0)
optional = 0;
}
else if (hdr->lines <= 0)
optional = 0;
break;
case 'L':
......@@ -491,7 +488,7 @@ hdr_format_str (char *dest,
}
else
{
if (hdr->score > 0)
if (hdr->score == 0)
optional = 0;
}
break;
......
......@@ -828,7 +828,7 @@ struct option_t MuttVars[] = {
{ "indent_str", DT_SYN, R_NONE, UL "indent_string", 0 },
/*
*/
{ "index_format", DT_STR, R_BOTH, UL &HdrFmt, UL "%4C %Z %{%b %d} %-15.15L (%4l) %s" },
{ "index_format", DT_STR, R_BOTH, UL &HdrFmt, UL "%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s" },
/*
** .pp
** This variable allows you to customize the message index display to
......@@ -853,7 +853,8 @@ struct option_t MuttVars[] = {
** .dt %f .dd entire From: line (address + real name)
** .dt %F .dd author name, or recipient name if the message is from you
** .dt %i .dd message-id of the current message
** .dt %l .dd number of lines in the message
** .dt %l .dd number of lines in the message (does not work with maildir,
** mh, and possibly IMAP folders)
** .dt %L .dd If an address in the To or CC header field matches an address
** defined by the users ``lists'' command, this displays
** "To <list-name>", otherwise the same as %F.
......
......@@ -1065,6 +1065,14 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short
{
if (hdr)
hdr->lines = atoi (p);
/*
* HACK - mutt has, for a very short time, produced negative
* Lines header values. Ignore them.
*/
if (hdr->lines < 0)
hdr->lines = 0;
matched = 1;
}
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment