Skip to content

Commit

Permalink
contrib/mmailto: Fix using longer arguments
Browse files Browse the repository at this point in the history
We put the args to $TERMINAL inside single quotes for terminals that want a single command,
and we put arguments extracted from the adress between double quotes to protect from spaces
  • Loading branch information
rakoo committed Apr 24, 2024
1 parent cf5493b commit 601189e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions contrib/mmailto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fi
IFS='
'

exec $TERMINAL -e mcom $(
args=$(
awk -v url="$1" '
function decode(s) {
Expand Down Expand Up @@ -47,7 +47,7 @@ BEGIN {
split(fields[i], kv, "=")
if (kv[1] != "r") {
args[length(args)+1] = "-" kv[1]
args[length(args)+1] = kv[2]
args[length(args)+1] = "\"" kv[2] "\""
}
}
for (i in args) {
Expand All @@ -56,3 +56,5 @@ BEGIN {
}
'
)

exec $TERMINAL -e "mcom $args"

0 comments on commit 601189e

Please sign in to comment.