]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
SCO sed doesn't have the immediate quit "Q" function. With regular q, the
authorAidan Van Dyk <aidan@ifax.com>
Wed, 4 Oct 2006 21:50:36 +0000 (21:50 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Wed, 4 Oct 2006 21:50:36 +0000 (21:50 +0000)
auto-print prints the blank line when doing:
$SED -e '1,/^$/q'
The blank line doesn't play well when we are trying to compose e-mail
headers.

To use the q, we have to suppress the default auto-printing, and then
include a print command "p", like:
$SED -n -e '[...];p'

This patch does that in the e-mail functions, so we now work on SCO as well.

Tested on Linux (GNU Awk), Solaris, and SCO OpenServer.

util/common-functions.sh.in

index 8f250bf1f9bdf22cbec16298e2b3696086339465..890c10b19aff24d1755ad773b463a17b9ec57624 100644 (file)
@@ -282,7 +282,7 @@ CreateMailMessage ()
     # First we take the top part of the e-mail for headers
     # Excluding any "Content-" lines, which need to stay with
     # the actual template content
-    $SED -e '/^$/Q' $1                 \
+    $SED -n -e '/^$/q;p' $1                    \
        | $GREP -v ^Content             \
        | template
 
@@ -300,13 +300,13 @@ CreateMailMessage ()
        | template
 
     echo ""
-    body_encoding=`$SED -e '/^$/Q' $1          \
+    body_encoding=`$SED -n -e '/^$/q;p' $1             \
        | $GREP -i ^Content-Transfer-Encoding   \
        | template                              \
        | $SED -e 's/^[^ ]*: *//'`;
     test "$body_encoding" || body_encoding=7bit;
 
-    $SED -e '1,/^$/d' $1 | template > $TMPDIR/body.txt
+    $SED -n -e '1,/^$/d;p' $1 | template > $TMPDIR/body.txt
     mimeEncode $TMPDIR/body.txt $body_encoding
 
     if [ -n "$2" ]; then