]> diplodocus.org Git - nmh/blobdiff - uip/mhmail
Fixed test-mhmail failure on Solaris: its tail doesn't suport -n.
[nmh] / uip / mhmail
index 2fbedccb61f64855abd03b6c44e79e5b152a9b56..70758cd6902bc607e6efc2fdc5256086a523e887 100755 (executable)
@@ -50,6 +50,11 @@ finddir() {
 
 bindir=`finddir $0`
 nmhbindir=`cd "$bindir" && pwd`
+if printf 'OK\n' | tail -n 1 2>&1 | grep OK >/dev/null; then
+    tail='tail -n'
+else
+    tail=tail
+fi
 
 
 #### Checks for missing mandatory arguments.
@@ -160,7 +165,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