summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-03-18 17:42:45 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-03-18 17:42:45 (EDT)
commit6f097f590b984ef3a69e181de7249bcfce106ddd (patch)
treeda82b457402274a9dd41a695692f1ef182299f57 /lib
parent54f1cb544e55189287ad05ef02e0bcdcbd9912c0 (diff)
ob_substvars(): Save untranslated var name for warning message
Diffstat (limited to 'lib')
-rw-r--r--lib/control.sh13
1 files changed, 7 insertions, 6 deletions
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