]> granicus.if.org Git - mutt/commitdiff
Fix #872, from Brendan Cully.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 25 Mar 2002 11:29:20 +0000 (11:29 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 25 Mar 2002 11:29:20 +0000 (11:29 +0000)
hdrline.c
muttlib.c

index 196211373c7e7609227e76f48e1fe6dcab1c9cd9..ffbaa8806250ed321fc742e0fb51c1aab1e6d36b 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -419,8 +419,13 @@ hdr_format_str (char *dest,
       break;
 
     case 'E':
-      snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
-      snprintf (dest, destlen, fmt, mutt_messages_in_thread(ctx, hdr, 0));
+      if (!optional)
+      {
+       snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
+       snprintf (dest, destlen, fmt, mutt_messages_in_thread(ctx, hdr, 0));
+      }
+      else if (mutt_messages_in_thread(ctx, hdr, 0) <= 1)
+       optional = 0;
       break;
 
     case 'f':
index 58637801da0f1516fcf0790f004047170db4a31c..4c2da94936ce496878845b5ec0c3c56893a6b12a 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -917,6 +917,7 @@ void mutt_FormatString (char *dest,         /* output buffer */
   char ifstring[SHORT_STRING], elsestring[SHORT_STRING];
   size_t wlen, count, len;
 
+  prefix[0] = '\0';
   destlen--; /* save room for the terminal \0 */
   wlen = (flags & M_FORMAT_ARROWCURSOR && option (OPTARROWCURSOR)) ? 3 : 0;