Single quote iniset argument in merge_config_file
If we don't single quote the extracted argument to iniset we drop any
quotes from the source. Add a simple test-case for this.
Partial-bug: #1374118
Change-Id: If2f47b64b11015e727a011c7e5f6e8ad378b90eb
diff --git a/lib/config b/lib/config
index 0baa4cc..a0b9b0a 100644
--- a/lib/config
+++ b/lib/config
@@ -82,6 +82,8 @@
local matchgroup=$2
local configfile=$3
+ # note in the awk below, \x27 is ascii for ' -- this avoids
+ # having to do nasty quoting games
get_meta_section $file $matchgroup $configfile | \
$CONFIG_AWK_CMD -v configfile=$configfile '
BEGIN { section = "" }
@@ -95,7 +97,7 @@
}
/^[^ \t]+/ {
split($0, d, " *= *")
- print "iniset " configfile " " section " " d[1] " \"" d[2] "\""
+ print "iniset " configfile " " section " " d[1] " \x27" d[2] "\x27 "
}
' | while read a; do eval "$a"; done