summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-06-24 17:51:40 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-06-24 17:51:40 (EDT)
commit96a1fdc278649dd7a5d3e6afd2bdb39ed5a71587 (patch)
tree4daa8006abafa2373f55f64480245687b05d224f
parent443e4291f8eca1dcafe92cecc897bdb67ca353a0 (diff)
ob_set_binary_substvar(), ob_substvars(): Improve "clean" naming
-rw-r--r--lib/control.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/control.sh b/lib/control.sh
index c7a8010..35913aa 100644
--- a/lib/control.sh
+++ b/lib/control.sh
@@ -245,7 +245,8 @@ ob_set_binary_substvar()
value="$(printf '%s' "${value}" | sed -n "${_OB_SUBSTVAR_TRIM_SED}")"
# Convert package name to clean form.
- package="$(printf '%s' "${package}" | tr 'A-Z' 'a-z' | tr -dC 'a-z0-9')"
+ package="$(printf '%s' "${package}" | tr 'A-Z' 'a-z' | \
+ tr -C 'a-z0-9' '_')"
# TODO: Maybe disallow variable names beginning with hyphens, and/or
# otherwise make this safer.
@@ -326,7 +327,7 @@ ob_substvars()
# Perform the substitution.
name_tr="$(printf '%s' "${name}" | tr 'A-Z-' 'a-z_')"
package="$(printf '%s' "${package}" | tr 'A-Z' 'a-z' | \
- tr -dC 'a-z0-9')"
+ tr -C 'a-z0-9' '_')"
if eval "[ x\"\${_ob_substvar_src_${name_tr}:+set}\" = x'set' ]"
then
name_tr="_ob_substvar_src_${name_tr}"