Fix tiny bugs

The rubber ducky method works!!
This commit is contained in:
Case Duckworth 2021-03-02 17:58:22 -06:00
parent 41a1534ee0
commit ca8db6208f
1 changed files with 8 additions and 9 deletions

17
bollux
View File

@ -378,11 +378,12 @@ usplit() { # usplit NAME:ARRAY URL:STRING
[[ $2 =~ $re ]] || return $?
# shellcheck disable=2034
local scheme="${BASH_REMATCH[2]}" \
authority="${BASH_REMATCH[4]}" \
path="${BASH_REMATCH[5]}" \
query="${BASH_REMATCH[7]}" \
fragment="${BASH_REMATCH[9]}"
local url="${BASH_REMATCH[0]}" \
scheme="${BASH_REMATCH[2]}" \
authority="${BASH_REMATCH[4]}" \
path="${BASH_REMATCH[5]}" \
query="${BASH_REMATCH[7]}" \
fragment="${BASH_REMATCH[9]}"
# 0=url 1=scheme 2=authority 3=path 4=query 5=fragment
local i=1 c
@ -390,13 +391,11 @@ usplit() { # usplit NAME:ARRAY URL:STRING
if [[ "${!c}" || "$c" == path ]]; then
printf -v "$1[$i]" '%s' "${!c}"
else
# shellcheck disable=2059
printf -v "$1[$i]" "$UC_BLANK"
printf -v "$1[$i]" '%s' "$UC_BLANK"
fi
((i += 1))
done
# shellcheck disable=2059
printf -v "$1[0]" "$(ujoin "$1")" # inefficient I'm sure
printf -v "$1[0]" '%s' "$url"
}
ujoin() { # ujoin NAME:ARRAY