summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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}"