changeset 851:f08046777694

[project @ 1994-10-21 01:21:13 by jwe]
author jwe
date Fri, 21 Oct 1994 01:21:13 +0000
parents 28f9d2470e72
children e4b2cd2ad0a2
files octave-bug.in
diffstat 1 files changed, 28 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/octave-bug.in	Thu Oct 20 23:41:00 1994 +0000
+++ b/octave-bug.in	Fri Oct 21 01:21:13 1994 +0000
@@ -73,7 +73,7 @@
 cat > $TEMP << EOF
 To: $BUGADDR
 Subject: $SUBJECT
-
+--------
 Bug report for Octave $VERSION configured for $MACHINE
 
 Description:
@@ -144,6 +144,33 @@
     echo "file not changed -- no bug report submitted"
     status=1
   else
+
+# Try to extract the recipient address, in case the To: line in the
+# message template has been changed.
+
+    TMP_BUGADDR=`sed -e '/^--------[ \t]*$/q' $TEMP | sed -n -e 's/^To://p'`
+    if test -z "$TMP_BUGADDR"
+    then
+      echo "no valid \`To:' field found in header -- using $BUGADDR instead"
+    else
+      BUGADDR="$TMP_BUGADDR"      
+    fi
+
+# Delete the `--------' separator in the message.
+
+    awk 'BEGIN{ in_header = 1; } \
+         /^--------[ \t]*$/ {
+           if (in_header) {
+             in_header = 0;
+             print "";
+             next;
+           }
+         } {
+           print $0;
+         }' $TEMP > $TEMP.msg
+
+# Now try to mail it.
+
     rmail $BUGADDR < $TEMP > /dev/null 2>&1 || \
     mailx -s "$SUBJECT" $BUGADDR < $TEMP > /dev/null 2>&1 || \
     Mail -s "$SUBJECT" $BUGADDR < $TEMP > /dev/null 2>&1 || \