delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/09/22/03:31:43

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: "Gary R. Van Sickle" <g DOT r DOT vansickle AT worldnet DOT att DOT net>
To: "Cygwin mailing list" <cygwin AT cygwin DOT com>
Subject: [PATCH] improved mutt-1.2.5i binary attachment handling
Date: Sat, 22 Sep 2001 02:39:13 -0500
Message-ID: <NCBBIHCHBLCMLBLOBONKEEOGCGAA.g.r.vansickle@worldnet.att.net>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

------=_NextPart_000_0006_01C1430F.C3E1A540
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

This patch fixes mutt so that it can now send binary attachments regardless
of mount mode.  No work done on receiving yet.  Tested with current Cygwin
ssmtp distro.

Changelog:

* lib.c (safe_fopen): Add support for binary mode specifier ("b").

* sendlib.c (mutt_write_mime_body): Open file to attach as binary prior to
encoding if it is not a text MIME type.

* configure.in (sig_atomic_t): Add brackets to sig_atomic_t test, it was
generating an invalid configure.
(binmode.o): Remove linkage to binmode.o to go back to default Cygwin file
mode behavior.

------=_NextPart_000_0006_01C1430F.C3E1A540
Content-Type: application/octet-stream;
	name="mutt.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="mutt.diff"

--- mutt-1.2.5i/lib.c	Tue May 16 10:23:12 2000
+++ mutt-1.2.5i-grvs/lib.c	Sat Sep 22 01:21:00 2001
@@ -374,11 +374,19 @@ FILE *safe_fopen (const char *path, cons
     flags |=3D O_NOFOLLOW;
 #endif
=20
-    if (mode[1] =3D=3D '+')
+    if (strchr(mode, '+') !=3D NULL)
       flags |=3D O_RDWR;
     else
       flags |=3D O_WRONLY;
=20
+    /* Check if binary mode is specified */
+#ifdef O_BINARY
+    if(strchr(mode, 'b') !=3D NULL)
+    {
+		flags |=3D O_BINARY;
+	}
+#endif
+
     if ((fd =3D safe_open (path, flags)) < 0)
       return (NULL);
=20
--- mutt-1.2.5i/sendlib.c	Sat May 20 01:39:00 2000
+++ mutt-1.2.5i-grvs/sendlib.c	Fri Sep 21 23:52:08 2001
@@ -482,8 +482,17 @@ int mutt_write_mime_body (BODY *a, FILE=20
 #endif /* HAVE_PGP */
=20
=20
+  /* Open the file to encode in the correct mode */
+  if(mutt_is_text_type (a->type, a->subtype))
+  {
+    fpin =3D fopen (a->filename, "r");
+  }
+  else
+  {
+    fpin =3D fopen (a->filename, "rb");
+  }
=20
-  if ((fpin =3D fopen (a->filename, "r")) =3D=3D NULL)
+  if (fpin =3D=3D NULL)
   {
     dprint(1,(debugfile, "write_mime_body: %s no longer =
exists!\n",a->filename));
     mutt_error (_("%s no longer exists!"), a->filename);
--- mutt-1.2.5i/configure.in	Sun Feb  4 16:24:00 2001
+++ mutt-1.2.5i-grvs/configure.in	Sat Sep 22 00:57:04 2001
@@ -204,9 +204,9 @@ AC_CHECK_FUNCS(setrlimit)
 AC_TYPE_SIGNAL
=20
 AC_MSG_CHECKING(for sig_atomic_t in signal.h)
-AC_EGREP_HEADER(sig_atomic_t,signal.h,dnl
-  [ ac_cv_type_sig_atomic_t=3Dyes; AC_MSG_RESULT(yes) ],dnl
-  AC_MSG_RESULT(no); AC_CHECK_TYPE(sig_atomic_t, int))
+AC_EGREP_HEADER(sig_atomic_t,signal.h,
+  [ ac_cv_type_sig_atomic_t=3Dyes; AC_MSG_RESULT(yes) ],
+  [ AC_MSG_RESULT(no); AC_CHECK_TYPE(sig_atomic_t, int) ])
=20
 AC_DECL_SYS_SIGLIST
=20
@@ -608,7 +608,6 @@ AC_SUBST(LIBIMAPDEPS)
 MUTT_AM_GNU_GETTEXT
 CPPFLAGS=3D"$CPPFLAGS -I\$(top_srcdir)/intl"
=20
-test "$ac_cv_cygwin" =3D yes && LIBS=3D"$LIBS /usr/lib/binmode.o"
 test "$ac_cv_cygwin" =3D yes && DATADIRNAME=3Dshare
=20
 MUTTLOCALEDIR=3D$mutt_cv_prefix/$DATADIRNAME/locale


------=_NextPart_000_0006_01C1430F.C3E1A540
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
------=_NextPart_000_0006_01C1430F.C3E1A540--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019