return;
struct Hook *tmp = NULL;
- struct Buffer err, token;
+ struct Buffer *err = mutt_buffer_pool_get();
+ struct Buffer *token = mutt_buffer_pool_get();
current_hook_type = MUTT_FOLDER_HOOK;
- mutt_buffer_init(&err);
- err.dsize = 256;
- err.data = mutt_mem_malloc(err.dsize);
- mutt_buffer_init(&token);
TAILQ_FOREACH(tmp, &Hooks, entries)
{
if (!tmp->command)
if ((path && (regexec(tmp->regex.regex, path, 0, NULL, 0) == 0) ^ tmp->regex.not) ||
(desc && (regexec(tmp->regex.regex, desc, 0, NULL, 0) == 0) ^ tmp->regex.not))
{
- if (mutt_parse_rc_line(tmp->command, &token, &err) == MUTT_CMD_ERROR)
+ if (mutt_parse_rc_line(tmp->command, token, err) == MUTT_CMD_ERROR)
{
- mutt_error("%s", err.data);
+ mutt_error("%s", mutt_b2s(err));
break;
}
}
}
- FREE(&token.data);
- FREE(&err.data);
+ mutt_buffer_pool_release(&token);
+ mutt_buffer_pool_release(&err);
current_hook_type = 0;
}