From dcf9e96aa3a3530b6f0e6afba8dc0c102b89dd51 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 02 Jul 2020 18:36:56 -0400 Subject: Prefix "static" vars with "_" --- (limited to 'src/substvars.sh') diff --git a/src/substvars.sh b/src/substvars.sh index bc0b052..7c72ed5 100644 --- a/src/substvars.sh +++ b/src/substvars.sh @@ -18,8 +18,8 @@ # along with the ProteanOS Development Kit. If not, see # . -SUBSTVARS_MAX_DEPTH=50 -SUBSTVAR_TRIM_SED=' +_SUBSTVARS_MAX_DEPTH=50 +_SUBSTVAR_TRIM_SED=' H; # Store each input line in the hold space. ${ # At the last line of input: g; # restore the hold space into the pattern space, @@ -44,7 +44,7 @@ set_substvar() name="$(printf '%s' "${name}" | tr 'A-Z-' 'a-z_')" # Trim leading and trailing whitespace from value. - value="$(printf '%s' "${value}" | sed -n "${SUBSTVAR_TRIM_SED}")" + value="$(printf '%s' "${value}" | sed -n "${_SUBSTVAR_TRIM_SED}")" eval "substvar_${name}=\"\${value}\"" @@ -82,7 +82,7 @@ substvars() # side of the matched space. depth=0 fi - if [ ${depth} -ge ${SUBSTVARS_MAX_DEPTH} ]; then + if [ ${depth} -ge ${_SUBSTVARS_MAX_DEPTH} ]; then # Warn of possible recursion. warn "$(get_msg 'substvar_deep_nesting')" return 1 -- cgit v0.9.1