aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc/functions.sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-08-07 00:07:46 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-08-07 00:07:46 +0000
commitdde385c7e8427fb5107bffb73ac87f665504e656 (patch)
treef1a25d12d9287d9c1590286880cbc3361064c21c /package/base-files/files/etc/functions.sh
parent5d42c0eb62e09e9aa6da62895876f7f548756bd6 (diff)
downloadupstream-dde385c7e8427fb5107bffb73ac87f665504e656.tar.gz
upstream-dde385c7e8427fb5107bffb73ac87f665504e656.tar.bz2
upstream-dde385c7e8427fb5107bffb73ac87f665504e656.zip
base-files: port functions.sh to new config_get
Signed-off-by: Malte S. Stretz <mss@apache.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17156 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/etc/functions.sh')
-rwxr-xr-xpackage/base-files/files/etc/functions.sh4
1 files changed, 2 insertions, 2 deletions
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"