summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyush Agarwal <ayush@fastmail.in>2021-11-06 21:25:58 +0530
committerAyush Agarwal <ayush@fastmail.in>2021-11-06 21:25:58 +0530
commitc372d15dfaf3b9e1a630939fa4df2b176deb533e (patch)
treea01a51fc6f57324b8e3ab91740c8ad70e9d799ea
parent9c07554223f8045ffae0256939588c2578404964 (diff)
fix: don't parse the 'username' and 'password' key
tessen wasn't excluding 'username' and 'password' as a key from the menu which isn't expected behaviour because the value of username is determined from the basename of the selected file and password is selected from the first line of the file
-rwxr-xr-xtessen2
1 files changed, 1 insertions, 1 deletions
diff --git a/tessen b/tessen
index a51c1b5..2b83d53 100755
--- a/tessen
+++ b/tessen
@@ -61,7 +61,7 @@ get_pass_data() {
# skip the password, validate each entry against $passdata_regex, store valid results
# ASSUMPTION: each key is unique otherwise, the value of the last non-unique key will be used
for idx in "${passdata[@]:1}"; do
- if [[ "$idx" =~ $passdata_regex ]]; then
+ if [[ "${idx%%:*}" != "username" && "${idx%%:*}" != "password" && "$idx" =~ $passdata_regex ]]; then
key="${idx%%:*}"
val="${idx#*: }"
PASSDATA_ARR["$key"]="$val"