struct uci_package *package = NULL;
char *name = NULL;
int ret = UCI_OK;
+ bool merge = false;
if (argc > 2)
return 255;
if (flags & CLI_FLAG_MERGE) {
if (uci_load(ctx, name, &package) != UCI_OK)
package = NULL;
+ else
+ merge = true;
}
ret = uci_import(ctx, input, name, &package, (name != NULL));
if (ret == UCI_OK) {
- if (flags & CLI_FLAG_MERGE) {
+ if (merge) {
ret = uci_save(ctx, package);
} else {
struct uci_element *e;
#define UCI_HANDLE_ERR(ctx) do { \
DPRINTF("ENTER: %s\n", __func__); \
int __val = 0; \
+ ctx->errno = 0; \
if (!ctx) \
return UCI_ERR_INVAL; \
if (!ctx->internal) \