changeset 793:3b5a59b0840d

common.subr: Shell variable quoting in eval in checkyesno() and checkyes()
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 30 Oct 2024 14:15:59 +0100
parents 954d3607e87d
children 3e775a9390af
files share/local-bsdtools/common.subr
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/share/local-bsdtools/common.subr	Wed Oct 30 00:48:32 2024 +0100
+++ b/share/local-bsdtools/common.subr	Wed Oct 30 14:15:59 2024 +0100
@@ -120,7 +120,7 @@
 checkyesno() {
     local _value
 
-    eval _value=\$\{"${1}"\}
+    eval _value=\"\$\{"${1}"\}\"
     case "${_value}" in
         # "yes", "true", "on", or "1"
         [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
@@ -154,7 +154,7 @@
 checkyes() {
     local _value
 
-    eval _value=\$\{"${1}"\}
+    eval _value=\"\$\{"${1}"\}\"
     case "${_value}" in
         # "yes", "true", "on", or "1"
         [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)