]> granicus.if.org Git - neomutt/commitdiff
More fixes. Note to self: The code which controls character set
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 27 Mar 2002 01:23:11 +0000 (01:23 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 27 Mar 2002 01:23:11 +0000 (01:23 +0000)
selection for attachments is far too complicated.

pgp.c

diff --git a/pgp.c b/pgp.c
index 8fd1b6a94dacb55352dfdb86f4bbef8434191f06..8d86bd950f19856493b22fb2c691b9cae7ecd531 100644 (file)
--- a/pgp.c
+++ b/pgp.c
@@ -1249,8 +1249,9 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist)
   char pgpoutfile[_POSIX_PATH_MAX];
   char pgperrfile[_POSIX_PATH_MAX];
   char pgpinfile[_POSIX_PATH_MAX];
-
-  char from_charset[STRING];
+  
+  char body_charset[STRING];
+  char *from_charset;
   const char *send_charset;
   
   FILE *pgpout = NULL, *pgperr = NULL, *pgpin = NULL;
@@ -1287,12 +1288,14 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist)
    * we have to convert from that to utf-8.  If noconv is not set,
    * we have to convert from $charset to utf-8.
    */
-  if (a->noconv)
-    mutt_get_body_charset (from_charset, sizeof (from_charset), a);
-  else
-    strfcpy (from_charset, NONULL(Charset), sizeof (from_charset));
   
-  if (!mutt_is_us_ascii (from_charset))
+  mutt_get_body_charset (body_charset, sizeof (body_charset), a);
+  if (a->noconv)
+    from_charset = body_charset;
+  else 
+    from_charset = Charset;
+    
+  if (!mutt_is_us_ascii (body_charset))
   {
     int c;
     FGETCONV *fc;
@@ -1302,7 +1305,7 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist)
     else
       send_charset = "utf-8";
     
-    fc = fgetconv_open (fp, Charset, "utf-8", M_ICONV_HOOK_FROM);
+    fc = fgetconv_open (fp, from_charset, "utf-8", M_ICONV_HOOK_FROM);
     while ((c = fgetconv (fc)) != EOF)
       fputc (c, pgpin);
     
@@ -1408,6 +1411,7 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist)
   b->unlink   = 1;
 
   b->noconv = 1;
+  b->use_disp = 0;
   
   if (!(flags & ENCRYPT))
     b->encoding = a->encoding;