#19131: uci does not allow empty string as an option value
------------------------+------------------------
  Reporter:  anonymous  |      Owner:  developers
      Type:  defect     |     Status:  reopened
  Priority:  normal     |  Milestone:
 Component:  packages   |    Version:  Trunk
Resolution:             |   Keywords:
------------------------+------------------------
Changes (by anonymous):

 * status:  closed => reopened
 * resolution:  wontfix =>


Comment:

 Then you should make it able to distinguish unset option with
 ptr->value = NULL

 {{{

 diff -rubp a/list.c b/list.c
 --- a/list.c    2014-12-25 14:24:52.000000000 +0100
 +++ b/list.c    2015-03-10 10:56:52.103593182 +0100
 @@ -679,7 +679,7 @@ int uci_set(struct uci_context *ctx, str
                 if (e)
                         ptr->o = uci_to_option(e);
         }
 -       if (!ptr->value[0]) {
 +       if (!ptr->value && !ptr->o && !ptr->s) {
                 /* if setting a nonexistant option/section to a
 nonexistant value,
                  * exit without errors */
                 if (!(ptr->flags & UCI_LOOKUP_COMPLETE))}}}

--
Ticket URL: <https://dev.openwrt.org/ticket/19131#comment:2>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets

Reply via email to