*e = NULL;
}
-static struct uci_element *uci_lookup_list(struct uci_list *list, const char *name)
+static inline struct uci_element *
+uci_lookup_list(struct uci_list *list, const char *name)
{
struct uci_element *e;
return NULL;
}
-static struct uci_element *uci_lookup_ext_section(struct uci_context *ctx, struct uci_ptr *ptr)
+static struct uci_element *
+uci_lookup_ext_section(struct uci_context *ctx, struct uci_ptr *ptr)
{
char *idxstr, *t, *section, *name;
struct uci_element *e = NULL;
UCI_THROW(ctx, UCI_ERR_INVAL);
done:
free(section);
+ ptr->section = e->name;
return e;
}
-int uci_lookup_ptr(struct uci_context *ctx, struct uci_ptr *ptr, char *str, bool extended)
+int
+uci_lookup_ptr(struct uci_context *ctx, struct uci_ptr *ptr, char *str, bool extended)
{
struct uci_element *e;
UCI_INTERNAL(uci_load, ctx, ptr->package, &ptr->p);
if (!ptr->p)
goto notfound;
+ ptr->last = &ptr->p->e;
} else {
ptr->p = uci_to_package(e);
+ ptr->last = e;
}
if (!ptr->section)
if (!e)
goto abort;
+ ptr->last = e;
ptr->s = uci_to_section(e);
if (ptr->option) {
goto abort;
ptr->o = uci_to_option(e);
+ ptr->last = e;
}
complete: