From 3db35394d054cd2c703f14e2fa3db661e8c22b99 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 8 Nov 2021 08:10:24 +0100 Subject: password_fill: Fix quoting for variable expansions See https://github.com/koalaman/shellcheck/wiki/SC2295 (cherry picked from commit fa806ad667c37a36323de5effe342364c2e75ddd) --- misc/userscripts/password_fill | 6 +++--- 1 file 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 -- cgit v1.2.3-54-g00ecf