From: Ken Hornstein Date: Sat, 11 Jan 2014 06:41:44 +0000 (-0500) Subject: Change test-mhmail so it can handle a MIMETYPEPROC that doesn't output X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/a376784b51d76aee169b9f358bc7ccef9d70a04a?ds=sidebyside Change test-mhmail so it can handle a MIMETYPEPROC that doesn't output the character set. --- diff --git a/test/mhmail/test-mhmail b/test/mhmail/test-mhmail index df921b6d..27188c77 100755 --- a/test/mhmail/test-mhmail +++ b/test/mhmail/test-mhmail @@ -21,12 +21,9 @@ content_type_string() { echo "text/plain; name=\"`basename $1`\"; charset=\"us-ascii\"" else # 1) Excise leading filename followed by : and any whitespace. - # 2) Insert semicolon if there isn't one before the first space. - # OpenBSD file --mime spits out things like "text/plain charset=...". - # 3) Wrap charset value in double quotes. Assume that it isn't already. - printf "%s %s%s" \ - `$MIMETYPEPROC $1 | sed -e 's/.*: *//' -e 's/\([^;]\) /\1; /' \ - -e 's/\(charset=\)\(.*\)/\1"\2"/'` "; name=\"`basename $1`\"" + # 2) Wrap charset value in double quotes. Assume that it isn't already. + printf "%s%s" \ + `$MIMETYPEPROC $1` "; name=\"`basename $1`\"; charset=\"us-ascii\"" fi }