+2009-05-13 12:21 +0200 Rocco Rutte <pdmef@gmx.net> (ce0e5c895032)
+
+ * mbox.c: Actually reopen mbox/mmdf files in case we find
+ modifications. Closes #2725.
+
+ Since the file is changed while we have it open in ctx->fp, we
+ likely get wrong information when parsing the mailbox. Now we
+ explicitely close and (re)open it.
+
+2009-05-12 16:26 +0200 Rocco Rutte <pdmef@gmx.net> (06e318bfe8f2)
+
+ * ChangeLog, mbox.c: Backout errorneously commited mbox atime fix
+
2009-05-12 15:21 +0200 Rocco Rutte <pdmef@gmx.net> (644cfc8070f7)
* OPS, mbox.c: Fix description for <save-message>
u->data = safe_strdup (a->mailbox);
u->next = *expn;
*expn = u;
- w = rfc822_cpy_adr (t);
+ w = rfc822_cpy_adr (t, 0);
w = mutt_expand_aliases_r (w, expn);
if (head)
last->next = w;
default: abort ();
}
- *last = rfc822_cpy_adr (p);
+ *last = rfc822_cpy_adr (p, 0);
while (*last)
last = &((*last)->next);
}
for (p = &g->as; *p; p = &((*p)->next))
;
- q = rfc822_cpy_adr (a);
+ q = rfc822_cpy_adr (a, 0);
q = mutt_remove_xrefs (g->as, q);
*p = q;
}
hdr->env->return_path = rfc822_parse_adrlist (hdr->env->return_path, return_path);
if (!hdr->env->from)
- hdr->env->from = rfc822_cpy_adr (hdr->env->return_path);
+ hdr->env->from = rfc822_cpy_adr (hdr->env->return_path, 0);
ctx->msgcount++;
}
curhdr->env->return_path = rfc822_parse_adrlist (curhdr->env->return_path, return_path);
if (!curhdr->env->from)
- curhdr->env->from = rfc822_cpy_adr (curhdr->env->return_path);
+ curhdr->env->from = rfc822_cpy_adr (curhdr->env->return_path, 0);
lines = 0;
}
default: abort ();
}
- *last = rfc822_cpy_adr (p);
+ *last = rfc822_cpy_adr (p, 0);
while (*last)
last = &((*last)->next);
}
{
static ADDRESS *tmp;
- if (!(tmp = rfc822_cpy_adr (r->addr)))
+ if (!(tmp = rfc822_cpy_adr (r->addr, 0)))
return NULL;
if(!tmp->next && !tmp->personal)
if (QueryTable[i].tagged)
{
ADDRESS *a = result_to_addr(QueryTable[i].data);
- rfc822_append (&naddr, a);
+ rfc822_append (&naddr, a, 0);
rfc822_free_address (&a);
}
if (QueryTable[i].tagged)
{
ADDRESS *a = result_to_addr(QueryTable[i].data);
- rfc822_append (&msg->env->to, a);
+ rfc822_append (&msg->env->to, a, 0);
rfc822_free_address (&a);
}
}
}
/* this should be rfc822_cpy_adrlist */
-ADDRESS *rfc822_cpy_adr (ADDRESS *addr)
+ADDRESS *rfc822_cpy_adr (ADDRESS *addr, int prune)
{
ADDRESS *top = NULL, *last = NULL;
for (; addr; addr = addr->next)
{
+ if (prune && addr->group && (!addr->next || !addr->next->mailbox))
+ {
+ addr = addr->next;
+ continue;
+ }
if (last)
{
last->next = rfc822_cpy_adr_real (addr);
}
/* append list 'b' to list 'a' and return the last element in the new list */
-ADDRESS *rfc822_append (ADDRESS **a, ADDRESS *b)
+ADDRESS *rfc822_append (ADDRESS **a, ADDRESS *b, int prune)
{
ADDRESS *tmp = *a;
if (!b)
return tmp;
if (tmp)
- tmp->next = rfc822_cpy_adr (b);
+ tmp->next = rfc822_cpy_adr (b, prune);
else
- tmp = *a = rfc822_cpy_adr (b);
+ tmp = *a = rfc822_cpy_adr (b, prune);
while (tmp && tmp->next)
tmp = tmp->next;
return tmp;
void rfc822_free_address (ADDRESS **);
void rfc822_qualify (ADDRESS *, const char *);
ADDRESS *rfc822_parse_adrlist (ADDRESS *, const char *s);
-ADDRESS *rfc822_cpy_adr (ADDRESS *addr);
+ADDRESS *rfc822_cpy_adr (ADDRESS *addr, int);
ADDRESS *rfc822_cpy_adr_real (ADDRESS *addr);
-ADDRESS *rfc822_append (ADDRESS **a, ADDRESS *b);
+ADDRESS *rfc822_append (ADDRESS **a, ADDRESS *b, int);
int rfc822_write_address (char *, size_t, ADDRESS *, int);
void rfc822_write_address_single (char *, size_t, ADDRESS *, int);
void rfc822_free_address (ADDRESS **addr);
if (flags && env->mail_followup_to && hmfupto == M_YES)
{
- rfc822_append (to, env->mail_followup_to);
+ rfc822_append (to, env->mail_followup_to, 1);
return 0;
}
if (!option(OPTREPLYSELF) && mutt_addr_is_user (env->from))
{
/* mail is from the user, assume replying to recipients */
- rfc822_append (to, env->to);
+ rfc822_append (to, env->to, 1);
}
else if (env->reply_to)
{
* in his From header.
*
*/
- rfc822_append (to, env->from);
+ rfc822_append (to, env->from, 0);
}
else if (!(mutt_addrcmp (env->from, env->reply_to) &&
!env->reply_to->next) &&
switch (query_quadoption (OPT_REPLYTO, prompt))
{
case M_YES:
- rfc822_append (to, env->reply_to);
+ rfc822_append (to, env->reply_to, 0);
break;
case M_NO:
- rfc822_append (to, env->from);
+ rfc822_append (to, env->from, 0);
break;
default:
}
}
else
- rfc822_append (to, env->reply_to);
+ rfc822_append (to, env->reply_to, 0);
}
else
- rfc822_append (to, env->from);
+ rfc822_append (to, env->from, 0);
return (0);
}
if (flags & SENDLISTREPLY)
{
tmp = find_mailing_lists (in->to, in->cc);
- rfc822_append (&out->to, tmp);
+ rfc822_append (&out->to, tmp, 0);
rfc822_free_address (&tmp);
if (in->mail_followup_to && hmfupto == M_YES &&
if ((flags & SENDGROUPREPLY) && (!in->mail_followup_to || hmfupto != M_YES))
{
/* if(!mutt_addr_is_user(in->to)) */
- rfc822_append (&out->cc, in->to);
- rfc822_append (&out->cc, in->cc);
+ rfc822_append (&out->cc, in->to, 1);
+ rfc822_append (&out->cc, in->cc, 1);
}
}
return 0;
* mail-followup-to header
*/
- t = rfc822_append (&e->mail_followup_to, e->to);
- rfc822_append (&t, e->cc);
+ t = rfc822_append (&e->mail_followup_to, e->to, 0);
+ rfc822_append (&t, e->cc, 1);
}
/* remove ourselves from the mail-followup-to header */
if (e->mail_followup_to && !mutt_is_list_recipient (0, e->to, e->cc))
{
if (e->reply_to)
- from = rfc822_cpy_adr (e->reply_to);
+ from = rfc822_cpy_adr (e->reply_to, 0);
else if (e->from)
- from = rfc822_cpy_adr (e->from);
+ from = rfc822_cpy_adr (e->from, 0);
else
from = mutt_default_from ();
default: abort ();
}
- *last = rfc822_cpy_adr (p);
+ *last = rfc822_cpy_adr (p, 0);
while (*last)
last = &((*last)->next);
}