fix uci_set_state for empty values
[openwrt/svn-archive/archive.git] / package / uci / files / lib / config / uci.sh
index c226f4fe1a6ab089eb4bff06845e08e89d4b27bd..38f3097f5b2444f626d73c8dca43217e64eea48f 100644 (file)
@@ -17,6 +17,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
+CONFIG_APPEND=
 uci_load() {
        local PACKAGE="$1"
        local DATA
 uci_load() {
        local PACKAGE="$1"
        local DATA
@@ -59,7 +60,7 @@ uci_set_state() {
        local OPTION="$3"
        local VALUE="$4"
 
        local OPTION="$3"
        local VALUE="$4"
 
-       [ -z "$VALUE" ] && return 0
+       [ "$#" = 4 ] || return 0
        /sbin/uci -P /var/state set "$PACKAGE.$CONFIG${OPTION:+.$OPTION}=$VALUE"
 }
 
        /sbin/uci -P /var/state set "$PACKAGE.$CONFIG${OPTION:+.$OPTION}=$VALUE"
 }