password_fill: Fix quoting for variable expansions

See https://github.com/koalaman/shellcheck/wiki/SC2295
This commit is contained in:
Florian Bruhin 2021-11-08 08:10:24 +01:00
parent fe3861b386
commit fa806ad667
1 changed files with 3 additions and 3 deletions

View File

@ -241,7 +241,7 @@ pass_backend() {
if $GPG "${GPG_OPTS[@]}" -d "$passfile" \
| grep --max-count=1 -iE "${match_line_pattern}${url}" > /dev/null
then
passfile="${passfile#$PREFIX}"
passfile="${passfile#"$PREFIX"}"
passfile="${passfile#/}"
files+=( "${passfile%.gpg}" )
fi
@ -250,7 +250,7 @@ pass_backend() {
if ((match_filename)) ; then
# add entries with matching filepath
while read -r passfile ; do
passfile="${passfile#$PREFIX}"
passfile="${passfile#"$PREFIX"}"
passfile="${passfile#/}"
files+=( "${passfile%.gpg}" )
done < <(find -L "$PREFIX" -iname '*.gpg' | grep "$url")
@ -267,7 +267,7 @@ pass_backend() {
else
if [[ $line =~ $user_pattern ]] ; then
# remove the matching prefix "user: " from the beginning of the line
username=${line#${BASH_REMATCH[0]}}
username=${line#"${BASH_REMATCH[0]}"}
break
fi
fi