X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=list.c;fp=list.c;h=c683dd236fd973feb2b8aef3e3b0de51e2c891ac;hb=270b8d75334a30d27b61d1382a36bb2450008799;hp=0b3a3f2ad2db079ddf73d523faef9987a09750d2;hpb=b03329065717161f591ac0e28030568e462ed31e;p=uci.git diff --git a/list.c b/list.c index 0b3a3f2..c683dd2 100644 --- a/list.c +++ b/list.c @@ -387,10 +387,14 @@ uci_lookup_ptr(struct uci_context *ctx, struct uci_ptr *ptr, char *str, bool ext /* if the section name validates as a regular name, pass through * to the regular uci_lookup function call */ - if (ptr->flags & UCI_LOOKUP_EXTENDED) - e = uci_lookup_ext_section(ctx, ptr); - else + if (ptr->flags & UCI_LOOKUP_EXTENDED) { + if (extended) + e = uci_lookup_ext_section(ctx, ptr); + else + UCI_THROW(ctx, UCI_ERR_INVAL); + } else { e = uci_lookup_list(&ptr->p->sections, ptr->section); + } if (!e) goto abort;