From: Michael Tremer Date: Fri, 6 Dec 2024 16:42:16 +0000 (+0000) Subject: initscripts: readhash: Only strip quotes if they exist X-Git-Tag: v2.29-core191~14^2~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=73661e5ee1acc30e40e41493c8dfca10aa1097d0;p=ipfire-2.x.git initscripts: readhash: Only strip quotes if they exist Signed-off-by: Michael Tremer Signed-off-by: Arne Fitzenreiter --- diff --git a/src/initscripts/system/functions b/src/initscripts/system/functions index 125aa1dc62..094e354956 100644 --- a/src/initscripts/system/functions +++ b/src/initscripts/system/functions @@ -899,7 +899,6 @@ readhash() { local line while read -r line; do - # Skip Blank Lines if [[ ${line} =~ ^[[:space:]]*$ ]]; then continue @@ -932,8 +931,12 @@ readhash() { fi # strip leading and trailing single quotes - val="${val#\'}" - val="${val%\'}" + case "${val}" in + '*') + val="${val#\'}" + val="${val%\'}" + ;; + esac printf -v "${array}[${key}]" "%s" "${val}" done < "${file}"