]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Move encode() from faxrcvd to common-functions.
authorAidan Van Dyk <aidan@ifax.com>
Sat, 12 Aug 2006 18:12:54 +0000 (18:12 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Sat, 12 Aug 2006 18:12:54 +0000 (18:12 +0000)
This should still be unified with mimeEncode in notify, but mimeEncode trumps
variables ($FILENAME) so is not quite suitable.

util/common-functions.sh.in
util/faxrcvd.sh.in

index f55114373f154285630d3b45fde7d79bc71bbdb4..a288ef3cc6958ae64cba9c11f25ffe85ef746566 100644 (file)
@@ -162,3 +162,23 @@ parseFaxInfo()
     '`
 }
 
+#
+# Produce mailable encoding for binary files.
+encode()
+{
+    if [ -x "$MIMENCODE" ]; then
+       $MIMENCODE < $1 2>$ERRORSTO
+    elif [ -x "$UUENCODE" ]; then
+       if [ "$ENCODING" = "base64" ]; then
+           $UUENCODE -m $1 $1 | grep -E -v "^begin|^====$" 2>$ERRORSTO
+       else
+           $UUENCODE $1 $1 | grep -E -v "^begin|^====$" 2>$ERRORSTO
+       fi
+    else
+       # Do not use "-x" for backward compatibility; even if it fails
+       # this is last chance to encode data, so there's nothing to lose.
+       $MIMENCODE < $1 2>$ERRORSTO
+    fi
+}
+
+
index 62392e97367731875ea9837d8b21aa7108e8961d..9503e686f7582c3ad82678287f0c8cc97921bc42 100644 (file)
@@ -135,26 +135,6 @@ if [ -f etc/FaxDictionary ]; then
 fi
 setInfoSize
 
-#
-# Produce mailable encoding for binary files.
-#
-encode()
-{
-    if [ -x "$MIMENCODE" ]; then
-       $MIMENCODE < $1 2>$ERRORSTO
-    elif [ -x "$UUENCODE" ]; then
-       if [ "$ENCODING" = "base64" ]; then
-           $UUENCODE -m $1 $1 | grep -E -v "^begin|^====$" 2>$ERRORSTO
-       else
-           $UUENCODE $1 $1 | grep -E -v "^begin|^====$" 2>$ERRORSTO
-       fi
-    else
-       # Do not use "-x" for backward compatibility; even if it fails
-       # this is last chance to encode data, so there's nothing to lose.
-       $MIMENCODE < $1 2>$ERRORSTO
-    fi
-}
-
 if [ -f $FILE ]; then
     #
     # Don't send FaxMaster duplicates, and FaxMaster may not even