struct uci_context* uci_init(char *config_file)
{
struct uci_context *ctx = uci_alloc_context();
- uci_add_history_path(ctx, "/var/state");
+ uci_add_delta_path(ctx, "/var/state");
if(uci_load(ctx, config_file, &p) != UCI_OK)
{
log_printf("/etc/config/%s is missing or corrupt\n", config_file);
char *value = NULL;
struct uci_ptr ptr;
+ if (!p)
+ return NULL;
+
memset(&ptr, 0, sizeof(ptr));
ptr.package = p->e.name;
ptr.section = section;
{
struct uci_element *e;
+ if (!p)
+ return;
+
uci_foreach_element(&p->sections, e)
if (!strcmp(type, uci_to_section(e)->type))
cb(e->name, priv);