Skip to content

Commit

Permalink
Fix handling of whitespaces in common_set_list function
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
okraits committed Jan 19, 2018
1 parent 18d5b6d commit 7ac1358
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ext/openwrt/scripts/functions/common/common
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ac1358

Please sign in to comment.