summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/package.sh32
1 files changed, 12 insertions, 20 deletions
diff --git a/lib/package.sh b/lib/package.sh
index 99f7b76..5111341 100644
--- a/lib/package.sh
+++ b/lib/package.sh
@@ -227,12 +227,10 @@ ob_get_source_parameter()
fi
# Convert field name to uppercase and validate.
- name="$(echo "${name}" | tr 'a-z-' 'A-Z_')"
- case "${name:- }" in
- *[!A-Z0-9_]*)
- return 125
- ;;
+ case "${name}" in *[!A-Za-z0-9-]* | '')
+ return 125
esac
+ name="$(echo "${name}" | tr 'a-z-' 'A-Z_')"
eval "printf '%s' \"\${_OB_SRCFIELD_${name}}\""
@@ -260,12 +258,10 @@ ob_get_binary_parameter()
tr -dC 'A-Z0-9')"
# Convert field name to uppercase and validate.
- name="$(echo "${name}" | tr 'a-z-' 'A-Z_')"
- case "${name:- }" in
- *[!A-Z0-9_]*)
- return 125
- ;;
+ case "${name}" in *[!A-Za-z0-9-]* | '')
+ return 125
esac
+ name="$(echo "${name}" | tr 'a-z-' 'A-Z_')"
eval "printf '%s' \"\${_OB_BINFIELD_${package}_${name}}\""
@@ -357,12 +353,10 @@ _ob_set_source_parameter()
value="${2}"
# Convert field name to uppercase and validate.
- name="$(echo "${name}" | tr 'a-z-' 'A-Z_')"
- case "${name:- }" in
- *[!A-Z0-9_]*)
- return 125
- ;;
+ case "${name}" in *[!A-Za-z0-9-]* | '')
+ return 125
esac
+ name="$(echo "${name}" | tr 'a-z-' 'A-Z_')"
_OB_SOURCE_PARAMETERS="${_OB_SOURCE_PARAMETERS} ${name}"
@@ -390,12 +384,10 @@ _ob_set_binary_parameter()
tr -dC 'A-Z0-9')"
# Convert field name to uppercase and validate.
- name="$(echo "${name}" | tr 'a-z-' 'A-Z_')"
- case "${name:- }" in
- *[!A-Z0-9_]*)
- return 125
- ;;
+ case "${name}" in *[!A-Za-z0-9-]* | '')
+ return 125
esac
+ name="$(echo "${name}" | tr 'a-z-' 'A-Z_')"
if ! echo " ${_OB_BINARY_PARAMETERS} " | grep " ${name} " \
>/dev/null 2>&1; then