aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2016-08-17 19:10:39 +0200
committerRasmus Steinke <rasi@xssn.at>2016-08-17 19:10:39 +0200
commitb0406cd1ba2417fa16a56475b9295ecad8abbfd5 (patch)
treea80da3b6031994abacef5af6faf64a135a8fa772
parentec6efa602d7df3a57233639d15623b946f46ad99 (diff)
downloadrofi-pass-1.4.2.tar.gz
try to fix password-only entries1.4.2
-rwxr-xr-xrofi-pass22
1 files changed, 12 insertions, 10 deletions
diff --git a/rofi-pass b/rofi-pass
index a8eb7aa..60ddc1a 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -257,18 +257,20 @@ Run ${default_do} with <span color='$help_color'>Enter</span>. For more help hit
password="${password_temp%%$'\n'*}"
pass_key_value=$(echo "${password_temp}" | awk '$1 ~ /:$/{$1=$1;print}')
declare -A stuff
- while read -r LINE; do
- _id="${LINE%%: *}"
- _val="${LINE#* }"
- stuff["${_id}"]=${_val}
- done < <(echo "${pass_key_value}")
stuff["pass"]=${password}
- if test "${stuff['autotype']+autotype}"
- then
- :
- else
+ if [[ -n $pass_key_value ]]; then
+ while read -r LINE; do
+ _id="${LINE%%: *}"
+ _val="${LINE#* }"
+ stuff["${_id}"]=${_val}
+ done < <(echo "${pass_key_value}")
+ if test "${stuff['autotype']+autotype}"
+ then
+ :
+ else
stuff["autotype"]="${USERNAME_field} :tab pass"
- fi
+ fi
+ fi
fi
pass_content="$(for key in "${!stuff[@]}"; do echo "${key}: ${stuff[$key]}"; done)"