/* command string null-terminated by strtok */
*str += strlen(*str) + 1;
- type = next_arg(ctx, str, true, true);
+ type = next_arg(ctx, str, true, false);
+ if (!uci_validate_str(type, false))
+ uci_parse_error(ctx, type, "invalid character in field");
name = next_arg(ctx, str, false, true);
assert_eol(ctx, str);
path = NULL;
/* check for updated history, flush */
- uci_load_history(ctx, p, true);
+ if (!uci_load_history(ctx, p, true))
+ goto done;
} else {
/* flush history */
- uci_load_history(ctx, NULL, true);
+ if (!uci_load_history(ctx, NULL, true))
+ goto done;
}
}