Escape any 's in the key name.

This commit is contained in:
Darren 'Tadgy' Austin 2019-08-10 00:04:21 +01:00
commit 05fc13bc1d

View file

@ -469,6 +469,9 @@ parse_ini() {
# Squash multiple consecutive blanks into a single space. # Squash multiple consecutive blanks into a single space.
((SQUASH_SPACES == 1)) && KEY="${KEY//+([[:blank:]])/ }" ((SQUASH_SPACES == 1)) && KEY="${KEY//+([[:blank:]])/ }"
# Escape any 's in the key name.
KEY="${KEY//\'/\'\\\'\'}"
# If the value starts with a " or ' it must end with same. # If the value starts with a " or ' it must end with same.
if [[ "${VALUE:0:1}" =~ [\"\'] ]]; then if [[ "${VALUE:0:1}" =~ [\"\'] ]]; then
if [[ "${VALUE:0:1}" == "${VALUE: -1:1}" ]]; then if [[ "${VALUE:0:1}" == "${VALUE: -1:1}" ]]; then