From 6dc0cd6d16f9c6723b3ee02562dec9f2b6595e67 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 11 Jan 2022 17:50:24 +0100 Subject: [PATCH] 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. --- pass-pick | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pass-pick b/pass-pick index 48ddeec..79a07a7 100755 --- a/pass-pick +++ b/pass-pick @@ -208,6 +208,8 @@ show_username() { result=$(_p_get_field "$1" "${PASS_USERNAME_FIELD}") if [ -z "$result" ]; then echo "${1##*/}" + else + echo "$result" fi }