From 6f097f590b984ef3a69e181de7249bcfce106ddd Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 18 Mar 2019 17:42:45 -0400 Subject: ob_substvars(): Save untranslated var name for warning message --- diff --git a/lib/control.sh b/lib/control.sh index 7a85715..7f39ecd 100644 --- a/lib/control.sh +++ b/lib/control.sh @@ -271,6 +271,7 @@ ob_substvars() local name= local rhs= local old_rhs= + local name_tr= local value= check_bin=false @@ -319,19 +320,19 @@ ob_substvars() esac # Perform the substitution. - name="$(printf '%s' "${name}" | tr 'a-z-' 'A-Z_')" - if eval "[ x\"\${_OB_SUBSTVAR_SRC_${name}:+set}\" = x'set' ]" + name_tr="$(printf '%s' "${name}" | tr 'a-z-' 'A-Z_')" + if eval "[ x\"\${_OB_SUBSTVAR_SRC_${name_tr}:+set}\" = x'set' ]" then - name="_OB_SUBSTVAR_SRC_${name}" + name_tr="_OB_SUBSTVAR_SRC_${name_tr}" elif ${check_bin} && eval "[ x\"\${_OB_SUBSTVAR_BIN_$(: \ - )${package}__${name}:+set}\" = x'set' ]"; then - name="_OB_SUBSTVAR_BIN_${package}__${name}" + )${package}__${name_tr}:+set}\" = x'set' ]"; then + name_tr="_OB_SUBSTVAR_BIN_${package}__${name_tr}" else _ob_warn_msg 'substvar_unknown' "${name}" string="${lhs}${rhs}" continue fi - value="$(eval "printf '%s' \"\${${name}}\"")" + value="$(eval "printf '%s' \"\${${name_tr}}\"")" string="${lhs}${value}${rhs}" depth=$((${depth} + 1)) done -- cgit v0.9.1