From 8bcabef1366478dc7fd2f0e77009919e1d9f8c81 Mon Sep 17 00:00:00 2001 From: Oliver Kraitschy Date: Wed, 31 Aug 2016 16:43:07 +0200 Subject: [PATCH] Fix handling of whitespaces in common_set_list function If the payload contains whitespaces (for example openvpn remote parameter), the common_set_list function splits the payload at these whitespaces. This commit fixes this issue. --- ext/openwrt/scripts/functions/common | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/openwrt/scripts/functions/common b/ext/openwrt/scripts/functions/common index c49f835..455d6a0 100755 --- a/ext/openwrt/scripts/functions/common +++ b/ext/openwrt/scripts/functions/common @@ -156,9 +156,11 @@ common_set_bool() { common_set_list() { local cfg="$1" local val="$2" - local element list=${val//,/ } $UCI_DELETE $cfg - for element in $list; do + local oldIFS="$IFS" + IFS=',' + for element in $val; do + IFS="$oldIFS" $UCI_ADD_LIST $cfg="$element" done return 0