base-files: config_get: prevent filename globbing

When config_get is called as "config_get section option" the option
is unexpectedly globbed by the shell which differs from the way options
are read to a variable with "config_get variable section option".
Add another layer of double quotes to fix it.

Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de>
This commit is contained in:
Günther Kelleter
2018-10-08 15:30:00 +02:00
committed by Jo-Philipp Wich
parent 37e91861cc
commit c3389ab135
2 changed files with 2 additions and 2 deletions

View File

@@ -92,7 +92,7 @@ config_unset() {
# config_get <section> <option>
config_get() {
case "$3" in
"") eval echo "\${CONFIG_${1}_${2}:-\${4}}";;
"") eval echo "\"\${CONFIG_${1}_${2}:-\${4}}\"";;
*) eval export ${NO_EXPORT:+-n} -- "${1}=\${CONFIG_${2}_${3}:-\${4}}";;
esac
}