From e71a53a49d80ba3cc72e678a00f50c2b5b7ca47e Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 10 Apr 2019 19:33:12 -0400 Subject: Add braces to param exps in arith substs --- diff --git a/src/control.sh b/src/control.sh index 56c70a1..8c180dd 100644 --- a/src/control.sh +++ b/src/control.sh @@ -43,7 +43,7 @@ parse_control() got_fields="${LF}" while IFS='' read -r line; do - control_line_nr=$(($control_line_nr + 1)) + control_line_nr=$((${control_line_nr} + 1)) if [ "x$(echo ${line})" = 'x' ]; then parse_control_error 'control_empty_line' elif [ "x${line#\#}" != "x${line}" ]; then diff --git a/src/db.sh b/src/db.sh index 15c8685..a18b76d 100644 --- a/src/db.sh +++ b/src/db.sh @@ -252,7 +252,7 @@ db_inc_references() dir="${dir}/${binver}_${arch}_${plat}" if [ -f "${dir}/references" ]; then refs="$(cat "${dir}/references")" - refs=$(($refs + 1)) + refs=$((${refs} + 1)) else refs=1 mkdir -p "${dir}" @@ -276,7 +276,7 @@ db_dec_references() dir="${dir}/${binver}_${arch}_${plat}" if [ -f "${dir}/references" ]; then refs="$(cat "${dir}/references")" - refs=$(($refs - 1)) + refs=$((${refs} - 1)) else refs=0 fi diff --git a/src/garbage.sh b/src/garbage.sh index 556f3db..4a47b4e 100644 --- a/src/garbage.sh +++ b/src/garbage.sh @@ -64,7 +64,7 @@ collect_garbage() while [ ${dirs} -gt 0 ]; do file="${file%/*}" try_rmdir "${base_dir}/${file}" - dirs=$(($dirs - 1)) + dirs=$((${dirs} - 1)) done done <"${garbage}" rm -f "${garbage}" @@ -81,7 +81,7 @@ mark_pool_garbage() info_v "$(get_msg 'marking_garbage_file')" "${file}" time=$(time) - time=$(($time + $conf_pool_gc_delay)) + time=$((${time} + ${conf_pool_gc_delay})) mkdir -p "${base_dir}/.db/garbage" printf '2 %s\n' "${file}" >>"${base_dir}/.db/garbage/${time}" diff --git a/src/main.sh b/src/main.sh index f83495c..75532d1 100644 --- a/src/main.sh +++ b/src/main.sh @@ -58,7 +58,7 @@ main() load_locale get_options "${@}" - shift $(($OPTIND - 1)) + shift $((${OPTIND} - 1)) base_dir="${opt_b:-.}" @@ -90,7 +90,7 @@ init_sigs() # as in the following loop hack. i=0 while [ ${i} -lt 127 ]; do - i=$(($i + 1)) + i=$((${i} + 1)) sig="$(kill -l ${i} 2>/dev/null)" || continue case "${sig}" in 'HUP' | 'INT' | 'QUIT' | 'ABRT' | 'ALRM' | 'TERM') @@ -182,6 +182,6 @@ handle_sig() if [ "x${exit_status:+set}" = 'xset' ]; then exit ${exit_status} else - exit $((128 + $sig)) + exit $((128 + ${sig})) fi } -- cgit v0.9.1