X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=file.c;h=04ef91e5e2193e5cda74536053ec12ba0575de84;hp=c670f0449e3fddd29531730586ea8efe9b2d37bd;hb=b485972f3a40be1627fb2bdd9904889a155f12e0;hpb=563f8dd6f0eb56780a00f5856bf7fcf40e39d845 diff --git a/file.c b/file.c index c670f04..04ef91e 100644 --- a/file.c +++ b/file.c @@ -123,13 +123,7 @@ static void uci_parse_config(struct uci_context *ctx, char **str) assert_eol(ctx, str); if (pctx->merge) { - UCI_TRAP_SAVE(ctx, error); - if (uci_set(ctx, pctx->package, name, NULL, type, NULL) != UCI_OK) - goto error; - UCI_TRAP_RESTORE(ctx); - return; -error: - UCI_THROW(ctx, ctx->err); + UCI_NESTED(uci_set, ctx, pctx->package, name, NULL, type, NULL); } else pctx->section = uci_alloc_section(pctx->package, type, name); } @@ -154,12 +148,7 @@ static void uci_parse_option(struct uci_context *ctx, char **str) assert_eol(ctx, str); if (pctx->merge) { - UCI_TRAP_SAVE(ctx, error); - uci_set(ctx, pctx->package, pctx->section->e.name, name, value, NULL); - UCI_TRAP_RESTORE(ctx); - return; -error: - UCI_THROW(ctx, ctx->err); + UCI_NESTED(uci_set, ctx, pctx->package, pctx->section->e.name, name, value, NULL); } else uci_alloc_option(pctx->section, name, value); }