summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-07-31 03:04:32 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-07-31 03:04:32 +0000
commit6a4edcadc1643e59532a42a0ff5646dfa3e93d68 (patch)
tree5dc6b2d8ba040612d0dfa46fa834924a7aef0d1d
parent473493c834420a5f518f641c1d1e62f2676260e5 (diff)
downloadmtk-20170518-6a4edcadc1643e59532a42a0ff5646dfa3e93d68.zip
mtk-20170518-6a4edcadc1643e59532a42a0ff5646dfa3e93d68.tar.gz
mtk-20170518-6a4edcadc1643e59532a42a0ff5646dfa3e93d68.tar.bz2
fix config_clear(), see #3054
SVN-Revision: 12036
-rwxr-xr-xpackage/base-files/files/etc/functions.sh5
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 01db77c..0314692 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}_} | \