From 3e5a9940c628c70677b7dd230ffe8016d0bfaef0 Mon Sep 17 00:00:00 2001 From: nbd Date: Thu, 31 Jul 2008 03:04:32 +0000 Subject: fix config_clear(), see #3054 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12036 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/etc/functions.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'package/base-files/files/etc') diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index 01db77ce3..0314692c5 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}_} | \ -- cgit v1.2.3