ossp-pkg/cfg/cfg_syn.c 1.22 -> 1.23
--- cfg_syn.c 2004/11/28 14:17:52 1.22
+++ cfg_syn.c 2004/11/28 17:23:45 1.23
@@ -57,6 +57,8 @@
size_t err_len)
{
cfg_syn_ctx_t ctx;
+ cfg_buf_t *buf;
+ cfg_rc_t rc;
void *yyscan;
/* argument sanity checking */
@@ -67,6 +69,10 @@
cfg_syn_lex_init(&yyscan);
cfg_syn_set_extra(&ctx, yyscan);
+ /* initialize temporary buffer context */
+ if ((rc = cfg_buf_create(&buf)) != CFG_OK)
+ return rc;
+
/* establish our own context which is passed
through the parser and scanner */
ctx.inputptr = in_ptr;
@@ -75,6 +81,7 @@
ctx.cfg = cfg;
ctx.node = NULL;
ctx.rv = CFG_OK;
+ ctx.buf = buf;
ctx.err_buf = err_buf;
ctx.err_len = err_len;
ctx.yyscan = yyscan;
@@ -83,6 +90,9 @@
if (cfg_syn_parse(&ctx))
ctx.rv = (ctx.rv == CFG_OK ? CFG_ERR_INT : ctx.rv);
+ /* destroy temporary buffer */
+ cfg_buf_destroy(buf);
+
/* destroy scanner */
cfg_syn_lex_destroy(yyscan);
|
|