Commit 3b0dfa60 3b0dfa604bc0ff846020adefd7252dc7e27cadad by Sergey Poznyakoff

Bugfixes

* libmu_sieve/sieve.y (mu_sieve_machine_clone): Fix memory allocation.
* mh/pick.c: Remove unused functions.
1 parent fb8195c0
......@@ -1137,19 +1137,19 @@ mu_sieve_machine_clone (mu_sieve_machine_t const parent,
}
/* Copy value space */
child->valspace = mu_sieve_calloc (parent, parent->valcount,
child->valspace = mu_sieve_calloc (child, parent->valcount,
sizeof child->valspace[0]);
child->valcount = child->valmax = parent->valcount;
for (i = 0; i < child->valcount; i++)
{
child->valspace[i].type = parent->valspace[i].type;
child->valspace[i].tag =
mu_sieve_strdup (parent, parent->valspace[i].tag);
mu_sieve_strdup (child, parent->valspace[i].tag);
switch (child->valspace[i].type)
{
case SVT_TAG:
child->valspace[i].v.string =
mu_sieve_strdup (parent, parent->valspace[i].v.string);
mu_sieve_strdup (child, parent->valspace[i].v.string);
break;
default:
......
......@@ -232,34 +232,6 @@ action_add (void *item, void *data)
return 0;
}
static void
parse_comp_match (int *pargc, char **argv)
{
int i, j;
int argc = *pargc;
for (i = j = 0; i < argc; i++)
{
if (strncmp (argv[i], "--", 2) == 0)
{
if (++i < argc)
{
pick_add_token (&lexlist, T_COMP, argv[i-1] + 2);
pick_add_token (&lexlist, T_STRING, argv[i]);
}
else
{
mu_error (_("%s: must be followed by a pattern"), argv[i-1]);
exit (1);
}
}
else
argv[j++] = argv[i];
}
argv[j] = NULL;
*pargc = j;
}
int
main (int argc, char **argv)
{
......@@ -267,7 +239,8 @@ main (int argc, char **argv)
mu_mailbox_t mbox;
mu_msgset_t msgset;
int argv_alloc = 0;
/* Expand eventual --COMPONENT NAME pairs */
for (i = 1; i < argc;)
{
if (strncmp (argv[i], "--", 2) == 0 && argv[i][3] && i + 1 < argc)
......@@ -299,8 +272,6 @@ main (int argc, char **argv)
mh_getopt (&argc, &argv, options, MH_GETOPT_DEFAULT_FOLDER,
args_doc, prog_doc, NULL);
parse_comp_match (&argc, argv);
if (pick_parse (lexlist))
return 1;
......