Fix regression for username fallback

While usernames were now picked up correctly as a fallback from the
filename if none were present in the fields themselves, if there were
any in the fields the program would return an empty string.

This fixes it for both cases, the username existing in the entry fields
or only in the filename. Entry fields will still take precedence.
This commit is contained in:
Marty Oehme 2022-01-11 17:50:24 +01:00
parent 2236d7fec8
commit 6dc0cd6d16
Signed by: Marty
GPG key ID: B7538B8F50A1C800

View file

@ -208,6 +208,8 @@ show_username() {
result=$(_p_get_field "$1" "${PASS_USERNAME_FIELD}") result=$(_p_get_field "$1" "${PASS_USERNAME_FIELD}")
if [ -z "$result" ]; then if [ -z "$result" ]; then
echo "${1##*/}" echo "${1##*/}"
else
echo "$result"
fi fi
} }