From 601189ea2c1d64a86f1851739254494c74c25416 Mon Sep 17 00:00:00 2001 From: Matthieu Rakotojaona Date: Wed, 24 Apr 2024 18:47:46 +0200 Subject: [PATCH] contrib/mmailto: Fix using longer arguments 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 --- contrib/mmailto | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/mmailto b/contrib/mmailto index 7feabb4..2b38def 100755 --- a/contrib/mmailto +++ b/contrib/mmailto @@ -19,7 +19,7 @@ fi IFS=' ' -exec $TERMINAL -e mcom $( +args=$( awk -v url="$1" ' function decode(s) { @@ -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) { @@ -56,3 +56,5 @@ BEGIN { } ' ) + +exec $TERMINAL -e "mcom $args"