diff options
author | Felix Fietkau <nbd@openwrt.org> | 2008-07-31 03:04:32 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2008-07-31 03:04:32 +0000 |
commit | 8c5e87f163207e214e02fe79c0562a3463b5fb0c (patch) | |
tree | 447633756788b14a7e1ec2e00d2d7cee60df365e /package | |
parent | f3eed39e806f2cfca50dd1a4b797bd1b4e6609ad (diff) | |
download | upstream-8c5e87f163207e214e02fe79c0562a3463b5fb0c.tar.gz upstream-8c5e87f163207e214e02fe79c0562a3463b5fb0c.tar.bz2 upstream-8c5e87f163207e214e02fe79c0562a3463b5fb0c.zip |
fix config_clear(), see #3054
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12036 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rwxr-xr-x | package/base-files/files/etc/functions.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index 01db77ce39..0314692c5f 100755 --- a/package/base-files/files/etc/functions.sh +++ b/package/base-files/files/etc/functions.sh @@ -44,6 +44,7 @@ list_remove() { val2="${val##* $remove }" [ "$val2" = "$val" ] && return val="${val1## } ${val2%% }" + val="${val%% }" eval "export ${NO_EXPORT:+-n} -- \"$var=\$val\"" } @@ -107,8 +108,8 @@ config_unset() { config_clear() { local SECTION="$1" local oldvar - - export ${NO_EXPORT:+-n} CONFIG_SECTIONS="$(echo " $CONFIG_SECTIONS " | sed -e "s, $OLD , ,")" + + list_remove CONFIG_SECTIONS "$SECTION" export ${NO_EXPORT:+-n} CONFIG_SECTIONS="${SECTION:+$CONFIG_SECTIONS}" for oldvar in `set | grep ^CONFIG_${SECTION:+${SECTION}_} | \ |