summaryrefslogtreecommitdiff
path: root/mh/repl.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-07-16 14:26:57 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-07-16 14:32:45 +0300
commit78f92501613a377b4c5bb2680dc071e928a96855 (patch)
tree7bf8cf9ee494415bd130d71f7dc959dc2b5e3344 /mh/repl.c
parente9871d0f003889c8fff79ee24cb23ae0c1103d5c (diff)
downloadmailutils-78f92501613a377b4c5bb2680dc071e928a96855.tar.gz
mailutils-78f92501613a377b4c5bb2680dc071e928a96855.tar.bz2
Remove dependency on obstack. Use mu_opool_t instead.
* include/mailutils/opool.h (mu_opool_alloc): New proto. * libmailutils/base/opool.c (mu_opool_alloc): New function. (mu_opool_appendz): Do not append trailing null character. * libmailutils/cfg/parser.y (mu_cfg_tree_create_node): Reflect the change in mu_opool_appendz. * comsat/action.c: Use mu_opool_t instead of struct obstack. * lib/mailcap.c: Likewise. * libmailutils/url/urlstr.c: Likewise. * mh/burst.c: Likewise. * mh/mh_fmtgram.y: Likewise. * mh/mh_format.c: Likewise. * mh/mh_format.h: Likewise. * mh/mhn.c: Likewise. * mh/repl.c: Likewise. * mh/whatnowenv.c: Likewise. * mimeview/mimetypes.l: Likewise. * mimeview/mimeview.h: Likewise. * gnulib.modules: Remove obstack.
Diffstat (limited to 'mh/repl.c')
-rw-r--r--mh/repl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mh/repl.c b/mh/repl.c
index 901cc8049..8500966a1 100644
--- a/mh/repl.c
+++ b/mh/repl.c
@@ -120,7 +120,7 @@ static char *mhl_filter = NULL; /* --filter flag */
static int annotate; /* --annotate flag */
static char *draftmessage = "new";
static const char *draftfolder = NULL;
-static struct obstack fcc_stack;
+static mu_opool_t fcc_pool;
static int has_fcc;
static int
@@ -243,12 +243,12 @@ opt_handler (int key, char *arg, struct argp_state *state)
case ARG_FCC:
if (!has_fcc)
{
- obstack_init (&fcc_stack);
+ mu_opool_create (&fcc_pool, 1);
has_fcc = 1;
}
else
- obstack_grow (&fcc_stack, ", ", 2);
- obstack_grow (&fcc_stack, arg, strlen (arg));
+ mu_opool_append (fcc_pool, ", ", 2);
+ mu_opool_appendz (fcc_pool, arg);
break;
case ARG_INPLACE:
@@ -348,7 +348,7 @@ make_draft (mu_mailbox_t mbox, int disp, struct mh_whatnow_env *wh)
mu_message_create_copy (&tmp_msg, msg);
mu_message_get_header (tmp_msg, &hdr);
- text = obstack_finish (&fcc_stack);
+ text = mu_opool_finish (fcc_pool, NULL);
mu_header_set_value (hdr, MU_HEADER_FCC, text, 0);
mh_format (&format, tmp_msg, msgno, width, &buf);
mu_message_destroy (&tmp_msg, NULL);

Return to:

Send suggestions and report system problems to the System administrator.