From: Felix Fietkau Date: Thu, 31 Jul 2008 03:04:32 +0000 (+0000) Subject: fix config_clear(), see #3054 X-Git-Tag: reboot~25952 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=6a4edcadc1643e59532a42a0ff5646dfa3e93d68;p=openwrt%2Fstaging%2Fjogo.git fix config_clear(), see #3054 SVN-Revision: 12036 --- 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}_} | \