]> diplodocus.org Git - nmh/blobdiff - uip/mhmail
Added unregister_for_removal(0) calls to the couple of children
[nmh] / uip / mhmail
index 70758cd6902bc607e6efc2fdc5256086a523e887..916732d8f502c0f5d68fc9e18d5c415fbdb1adaf 100755 (executable)
@@ -50,11 +50,10 @@ finddir() {
 
 bindir=`finddir $0`
 nmhbindir=`cd "$bindir" && pwd`
 
 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
+case `printf 'OK\n' | tail -n 1 2>&1` in
+  OK) tail='tail -n ' ;;
+  *)  tail='tail -' ;;
+esac
 
 
 #### Checks for missing mandatory arguments.
 
 
 #### Checks for missing mandatory arguments.
@@ -261,12 +260,12 @@ if [ "$body"x = x ]; then
   fi
 
   #### Add trailing newline to body if it doesn't have one.
   fi
 
   #### Add trailing newline to body if it doesn't have one.
-  if [ `tail -n 1 "$message_file" | wc -l` -ne 1 ]; then
+  if [ `${tail}1 "$message_file" | wc -l` -ne 1 ]; then
     printf '\n' >>"$message_file" || exit 2
   fi
 else
   #### Add trailing newline to body if it doesn't have one.
     printf '\n' >>"$message_file" || exit 2
   fi
 else
   #### Add trailing newline to body if it doesn't have one.
-  [ `printf %s "$body" | tail -n 1 | wc -l` -ne 1 ]  &&  body="$body
+  [ `printf %s "$body" | ${tail}1 | wc -l` -ne 1 ]  &&  body="$body
 "
 
   if [ "$tmpfileresent" ]; then
 "
 
   if [ "$tmpfileresent" ]; then