summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-11-08 08:10:24 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-11-08 08:27:34 +0100
commitfa806ad667c37a36323de5effe342364c2e75ddd (patch)
tree39a017645afd87d62743414713812b6d2f6f3c75
parentfe3861b38627e23a02252ea40f1258cf4136f483 (diff)
downloadqutebrowser-fa806ad667c37a36323de5effe342364c2e75ddd.tar.gz
qutebrowser-fa806ad667c37a36323de5effe342364c2e75ddd.zip
password_fill: Fix quoting for variable expansions
See https://github.com/koalaman/shellcheck/wiki/SC2295
-rwxr-xr-xmisc/userscripts/password_fill6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/userscripts/password_fill b/misc/userscripts/password_fill
index c46253d41..3ea8fd9f6 100755
--- a/misc/userscripts/password_fill
+++ b/misc/userscripts/password_fill
@@ -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