From: Felix Fietkau Date: Fri, 7 Aug 2009 00:07:46 +0000 (+0000) Subject: base-files: port functions.sh to new config_get X-Git-Tag: reboot~22732 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=387b221aa1a160057c9394a69e72f0657fa18197;p=openwrt%2Fstaging%2Flynxis.git base-files: port functions.sh to new config_get Signed-off-by: Malte S. Stretz SVN-Revision: 17156 --- diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index efa378f006..eb7faac1fe 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"