Handle the case of pipe char in value for iniset
iniset did not handle the case of "|" in the value
to be injected. Fix this by replacing | with \000 (NULL).
Fixes bug #1258050
Change-Id: I8882c2f3f177ebdfa0c66270dbbc7fd50f30b065
diff --git a/functions b/functions
index 0280b2b..995be57 100644
--- a/functions
+++ b/functions
@@ -741,8 +741,9 @@
$option = $value
" "$file"
else
+ local sep=$(echo -ne "\x01")
# Replace it
- sed -i -e "/^\[$section\]/,/^\[.*\]/ s|^\($option[ \t]*=[ \t]*\).*$|\1$value|" "$file"
+ sed -i -e '/^\['${section}'\]/,/^\[.*\]/ s'${sep}'^\('${option}'[ \t]*=[ \t]*\).*$'${sep}'\1'"${value}"${sep} "$file"
fi
}