X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topgit.git;a=blobdiff_plain;f=tg-mail.sh;h=7b8f7ffdd61b9b9b802df04790be5d51ffa67c2a;hp=dd50004a96127f9b6a26a93d1c47503c8aa1882d;hb=418f00b2cbaebc8b6455ee045fe79461625cc876;hpb=fde494fdb3a1606f68a410e789e4f930a68b5df0 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"