diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2013-02-05 11:45:33 +0100 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2013-02-05 11:45:33 +0100 |
commit | 6a674402ea6c871dbb164a7c180d67f078d7fc2f (patch) | |
tree | b2dbf4d610a47a2490938305740f46f53b9e0391 /src | |
parent | 7dd5bf25fc96936fb0af7955de569939bbd2b763 (diff) |
conf: perform aftercheck on ctx-copy
Afterchecks should be always performed when reading data into a config
context. So perform them after copy operations, too.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/conf.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -123,7 +123,7 @@ void *conf_ctx_get_mem(struct conf_ctx *ctx) int conf_ctx_parse_ctx(struct conf_ctx *ctx, const struct conf_ctx *src) { unsigned int i; - struct conf_option *d, *s; + struct conf_option *d, *s, *o; int ret; if (!ctx || !src) @@ -154,6 +154,15 @@ int conf_ctx_parse_ctx(struct conf_ctx *ctx, const struct conf_ctx *src) } } + for (i = 0; i < ctx->onum; ++i) { + o = &ctx->opts[i]; + if (o->aftercheck) { + ret = o->aftercheck(o, 0, NULL, 0); + if (ret < 0) + return ret; + } + } + return 0; } |