Commit d8823b90 authored by Rocco Rutte's avatar Rocco Rutte

Fix some issues with ungroup [...] *

parent 28101c2f
2009-07-27 21:14 -0700 Kees Cook <[email protected]> (2fc9348684fe)
* mh.c: Properly propagate mh_read_sequences result. Closes #3308.
2009-07-27 20:49 -0700 Brendan Cully <[email protected]> (5c076ed18883)
* configure.ac: Do not overwrite docdir unless --with-
docdir was explicitly given. This allows --docdir from autoconf
2.60+ to work, though if given --with-docdir will silently override
--docdir. Closes #3282.
2009-07-24 14:30 +0200 Rocco Rutte <[email protected]> (86e066a206ac)
* po/de.po: Update German translation
......
......@@ -53,32 +53,26 @@ group_t *mutt_pattern_group (const char *k)
return p;
}
static void group_free (void *p)
static void mutt_group_remove (group_t *g)
{
group_t *g = (group_t *)p;
if (!g)
return;
FREE(&g->name);
hash_delete (Groups, g->name, g, NULL);
rfc822_free_address (&g->as);
mutt_free_rx_list (&g->rs);
FREE(&g->name);
FREE(&g);
}
int mutt_group_remove (group_t * g, BUFFER * err)
int mutt_group_context_clear (group_context_t **ctx)
{
int h;
if (!g)
return -1;
h = Groups->hash_string ((const unsigned char *)g->name, Groups->nelem);
if (!hash_find_hash (Groups, h, g->name))
group_context_t *t;
for ( ; ctx && *ctx; (*ctx) = t)
{
if (err)
snprintf (err->data, err->dsize, _("No such group: %s"), g->name);
return -1;
mutt_group_remove ((*ctx)->g);
t = (*ctx)->next;
FREE(ctx); /* __FREE_CHECKED__ */
}
hash_delete_hash (Groups, h, g->name, g, group_free);
return 0;
}
......@@ -167,7 +161,7 @@ int mutt_group_context_remove_adrlist (group_context_t *ctx, ADDRESS * a)
{
rv = mutt_group_remove_adrlist (ctx->g, a);
if (empty_group (ctx->g))
mutt_group_remove (ctx->g, NULL);
mutt_group_remove (ctx->g);
}
return rv;
......@@ -191,7 +185,7 @@ int mutt_group_context_remove_rx (group_context_t *ctx, const char *s)
{
rv = mutt_group_remove_rx (ctx->g, s);
if (empty_group (ctx->g))
mutt_group_remove (ctx->g, NULL);
mutt_group_remove (ctx->g);
}
return rv;
......
......@@ -32,7 +32,7 @@ int mutt_group_context_add_rx (group_context_t *ctx, const char *s, int flags, B
int mutt_group_match (group_t *g, const char *s);
int mutt_group_remove (group_t *, BUFFER *);
int mutt_group_context_clear (group_context_t **ctx);
int mutt_group_context_remove_rx (group_context_t *ctx, const char *s);
int mutt_group_context_remove_adrlist (group_context_t *ctx, ADDRESS *);
......
......@@ -843,7 +843,7 @@ static int parse_group (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err)
if (data == M_UNGROUP && !mutt_strcasecmp (buf->data, "*"))
{
if (mutt_group_remove (gc->g, err) < 0)
if (mutt_group_context_clear (&gc) < 0)
goto bail;
goto out;
}
......
......@@ -89,6 +89,7 @@ static void free_address (ADDRESS *a)
#ifdef EXACT_ADDRESS
FREE(&a->val);
#endif
FREE(&a);
}
int rfc822_remove_from_adrlist (ADDRESS **a, const char *mailbox)
......
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