diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-10-07 11:14:35 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-10-07 11:14:35 +0000 |
commit | 40e1fab1466cd2db0ca8f376a1be70c180297037 (patch) | |
tree | c07c3d7891c41056cc6368779c56390f2cfba915 /hdrline.c | |
parent | 7826fc45bda88573dcc9f794b8f46a4c73f2fa66 (diff) |
The attached patch fixes a minor bug in $index_format's %B and %b
where they didnt respect the given prefix. In addition, the manual
says that %B is supposed to fall back to %b if the message is not
sent to a known mailing list. The code was not doing that. (From:
Vikas Agnihotri <VikasA@att.com>, noted on comp.mail.mutt by
unny@rz114s0.rz.uni-karlsruhe.de (Vladimir Klebanov)).
Diffstat (limited to 'hdrline.c')
-rw-r--r-- | hdrline.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -258,7 +258,14 @@ hdr_format_str (char *dest, if (!first_mailing_list (dest, destlen, hdr->env->to) && !first_mailing_list (dest, destlen, hdr->env->cc)) dest[0] = 0; - break; + if (dest[0]) + { + strfcpy (buf2, dest, sizeof(buf2)); + snprintf (fmt, sizeof (fmt), "%%%ss", prefix); + snprintf (dest, destlen, fmt, buf2); + break; + } + /* fall through if 'B' returns nothing */ case 'b': if(ctx) @@ -270,6 +277,9 @@ hdr_format_str (char *dest, } else strfcpy(dest, "(null)", destlen); + snprintf (fmt, sizeof (fmt), "%%%ss", prefix); + strfcpy (buf2, dest, sizeof(buf2)); + snprintf (dest, destlen, fmt, buf2); break; case 'c': |