]> granicus.if.org Git - mutt/commitdiff
Avoid dumping core when Charset isn't set.
authorThomas Roessler <roessler@does-not-exist.org>
Thu, 15 Jun 2000 10:05:32 +0000 (10:05 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Thu, 15 Jun 2000 10:05:32 +0000 (10:05 +0000)
copy.c
handler.c
rfc2047.c
sendlib.c

diff --git a/copy.c b/copy.c
index 5ae716c11479f8c13e8411752df1a75f80d7c480..596f1b6f45dd2e5f6f63f9566693459beeb3ed65 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -294,7 +294,7 @@ mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix)
     fputs ("Mime-Version: 1.0\n", out);
     fputs ("Content-Transfer-Encoding: 8bit\n", out);
     fputs ("Content-Type: text/plain; charset=", out);
-    rfc822_cat(buffer, sizeof(buffer), Charset, MimeSpecials);
+    rfc822_cat(buffer, sizeof(buffer), Charset ? Charset : "", MimeSpecials);
     fputs(buffer, out);
     fputc('\n', out);
     
index 671c5200a0c98f457d490c3897a4dab394ef737e..c59e9458a84c9ac16c04f0fe3bdbd12311982086 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -1340,7 +1340,7 @@ void mutt_decode_attachment (BODY *b, STATE *s)
   if (istext && s->flags & M_CHARCONV)
   {
     char *charset = mutt_get_parameter ("charset", b->parameter);
-    if (charset)
+    if (charset && Charset)
       cd = mutt_iconv_open (Charset, charset);
   }
 
index 811a1e259b4ab34af41ef0291aafacf320a33196..214240df0e0a1632e2042068378fc18e6effb7c5 100644 (file)
--- a/rfc2047.c
+++ b/rfc2047.c
@@ -454,9 +454,10 @@ void rfc2047_encode_string (char **pd)
   size_t elen;
   char *charsets;
 
+  if (!Charset)
+    return;
+
   charsets = SendCharset;
-  if (!charsets || !*charsets)
-    charsets = Charset;
   if (!charsets || !*charsets)
     charsets = "UTF-8";
 
index f43b63aa2c0db5a84eb81d7ad560dc218d1919c4..3f4745cf0fced8a6c33d8a14d771af9917947a57 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -844,7 +844,8 @@ CONTENT *mutt_get_content_info (const char *fname, BODY *b)
   if (b != NULL && b->type == TYPETEXT && (!b->noconv))
   {
     char *chs = mutt_get_parameter ("charset", b->parameter);
-    if (convert_file_from_to (fp, Charset, chs ? chs : SendCharset,
+    if (Charset && (chs || SendCharset) &&
+       convert_file_from_to (fp, Charset, chs ? chs : SendCharset,
                              &fromcode, &tocode, info) != (size_t)(-1))
     {
       if (!chs)