aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2024-01-13 23:38:18 +0100
committerFederico Angelilli <code@fedang.net>2024-01-13 23:38:18 +0100
commit5b79fbae344eb2a08f5126d953d3e8f7c3052dce (patch)
treedb59d6356f55145978cfdd61fbf6e3a944a10a9b
parentb363ed6f7be97658e8c148e05fabc6bb12f993a4 (diff)
Improve quote stripping
-rwxr-xr-xcrypt.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/crypt.sh b/crypt.sh
index b904d76..3a593a5 100755
--- a/crypt.sh
+++ b/crypt.sh
@@ -281,7 +281,10 @@ load_entries() {
for w in "${arr[@]}"; do
IFS='=' read -r k v <<< "$w"
opts["$k"]="${v:-none}"
- [[ "${opts[$k]}" == $'"'* ]] && opts["$k"]="${opts[$k]:1:-1}" # Strip quotes
+ case "${opts[$k]}" in
+ $'"'*|$'\''*) opts["$k"]="${opts[$k]:1:-1}" ;;
+ # TODO: Fix string parsing
+ esac
done
[ -z "${opts[name]}" ] && error "Extension not given for entry #$i"