]> granicus.if.org Git - neomutt/commitdiff
Change the default format to be more friendly to "0-line messages",
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 13 Feb 2002 11:33:16 +0000 (11:33 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 13 Feb 2002 11:33:16 +0000 (11:33 +0000)
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.

hdrline.c
init.h
parse.c

index 619d57cfa99a7b536fdc1468d0834912d14cf6e1..196211373c7e7609227e76f48e1fe6dcab1c9cd9 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -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;
diff --git a/init.h b/init.h
index 0755d5372c8feac09514d850067176f254c1542a..e4f8560513f689b612ccf82435c5aa12015f697d 100644 (file)
--- a/init.h
+++ b/init.h
@@ -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.
diff --git a/parse.c b/parse.c
index 2cf48392d6cf07ac052ef5ad03fa859cda4a08f6..d3ff9233cd3090aa089bd7e777572fa8a2955e48 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -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;