From: David Levine Date: Sat, 2 Feb 2013 16:12:57 +0000 (-0600) Subject: Added trailing newline to sed input in mhmail when processing X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/b62b8df32ba9e6b6ed4787d0621c64cb6ac59c83?ds=inline;hp=12bf24b49f290ba3581add8407aa21a618db296a Added trailing newline to sed input in mhmail when processing -headerfield argument, to squelch complain from Solaris sed. --- diff --git a/test/mhmail/test-mhmail b/test/mhmail/test-mhmail index 1f21e638..144a362e 100755 --- a/test/mhmail/test-mhmail +++ b/test/mhmail/test-mhmail @@ -38,13 +38,9 @@ test_mhmail () # Message-ID. # -ls -l $actual >&2 # ???? temporary -od -t a $actual | tail -n 4 - sed -e 's/^Date:.*/Date:/' \ -e 's/^Resent-Date:.*/Resent-Date:/' \ -e 's/^Message-ID:.*/Message-ID:/' "$actual" > "$actual".nodate -echo after sed # ???? temporary rm -f "$actual" check "$actual".nodate "$1" diff --git a/uip/mhmail b/uip/mhmail index 2fbedccb..839b82a7 100755 --- a/uip/mhmail +++ b/uip/mhmail @@ -160,7 +160,8 @@ for arg in "$@"; do #### It's not strictly necessary to have one space after #### the : that separates the header field name from the #### body, but do it to avoid surprising someone. - add=`printf %s "$arg" | sed -e 's/:/: /' -e 's/: /: /'` + #### Solaris sed wants the trailing newline in its input. + add=`printf '%s\n' "$arg" | sed -e 's/:/: /' -e 's/: /: /'` headerfieldlist="${headerfieldlist:+$headerfieldlist}$add " headerfieldarg=0