X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/eb62b765c45172f63920af29c017c90f65ce62df..d84cebe2b4f101902f62f0e25fc473d1af7bb269:/package/base-files/files/etc/functions.sh diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index efa378f00..eb7faac1f 100755 --- a/package/base-files/files/etc/functions.sh +++ b/package/base-files/files/etc/functions.sh @@ -91,8 +91,8 @@ list() { local value="$*" local len - config_get len "$CONFIG_SECTION" "${varname}_LENGTH" - len="$((${len:-0} + 1))" + config_get len "$CONFIG_SECTION" "${varname}_LENGTH" 0 + len=$(($len + 1)) config_set "$CONFIG_SECTION" "${varname}_ITEM$len" "$value" config_set "$CONFIG_SECTION" "${varname}_LENGTH" "$len" append "CONFIG_${CONFIG_SECTION}_${varname}" "$value" "$LIST_SEP"