diff options
author | Ayush Agarwal <ayush@fastmail.in> | 2021-11-06 21:25:58 +0530 |
---|---|---|
committer | Ayush Agarwal <ayush@fastmail.in> | 2021-11-06 21:25:58 +0530 |
commit | c372d15dfaf3b9e1a630939fa4df2b176deb533e (patch) | |
tree | a01a51fc6f57324b8e3ab91740c8ad70e9d799ea | |
parent | 9c07554223f8045ffae0256939588c2578404964 (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-x | tessen | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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" |