}
}
-int uci_load(struct uci_context *ctx, const char *name)
+int uci_load(struct uci_context *ctx, const char *name, struct uci_config **cfg)
{
struct uci_parse_context *pctx;
struct stat statbuf;
/* add to main config file list */
uci_list_add(&ctx->root, &pctx->cfg->list);
+ if (cfg)
+ *cfg = pctx->cfg;
+
pctx->cfg = NULL;
/* no error happened, we can get rid of the parser context now */