From 6423f07442eddd157516839e149d328b74adb2c1 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Fri, 26 Sep 2008 21:04:19 +0200 Subject: [PATCH] tg-mail: do not use arrays, which are bashisms tg-mail uses shell arrays for the people array, which are not supported by POSIX. The script runs as /bin/sh, so it cannot assume non-POSIX features. This patch reimplements the array population with a POSIX-compliant approach. Signed-off-by: martin f. krafft --- tg-mail.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tg-mail.sh b/tg-mail.sh index dd50004..7b8f7ff 100644 --- a/tg-mail.sh +++ b/tg-mail.sh @@ -46,14 +46,12 @@ from="$(echo "$header" | grep '^From:' | sed 's/From:\s*//')" to="$(echo "$header" | grep '^To:' | sed 's/To:\s*//')" -# XXX: I can't get quoting right without arrays -people=() -[ -n "$from" ] && people=("${people[@]}" --from "$from") +people= +[ -n "$from" ] && people="$people --from '$from'" # FIXME: there could be multimple To -[ -n "$to" ] && people=("${people[@]}" --to "$to") - +[ -n "$to" ] && people="$people --to '$to'" # NOTE: git-send-email handles cc itself -git send-email $send_email_args "${people[@]}" "$patchfile" +eval git send-email $send_email_args "$people" "$patchfile" rm "$patchfile" -- 2.30.2