diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-04-12 17:34:10 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-04-12 17:34:10 +0000 |
commit | 5dbccdb1c144d3a53e254af8f4d3f9272efadfbb (patch) | |
tree | 7cbb0159c38affb67d5708067a3dfb7e1d59a2a7 /sendlib.c | |
parent | 179b1757f7b9a89812b975b5696c1c6be0d336a3 (diff) |
Fix default character set setting when attaching text files.
Diffstat (limited to 'sendlib.c')
-rw-r--r-- | sendlib.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1054,6 +1054,7 @@ BODY *mutt_make_file_attach (const char *path) /* Attempt to determine the appropriate content-type based on the filename * suffix. */ + if ((n = lookup_mime_type (buf, path)) != TYPEOTHER) { att->type = n; @@ -1070,7 +1071,6 @@ BODY *mutt_make_file_attach (const char *path) */ att->type = TYPETEXT; att->subtype = safe_strdup ("plain"); - mutt_set_body_charset(att, get_text_charset(att, info)); } else { @@ -1079,9 +1079,14 @@ BODY *mutt_make_file_attach (const char *path) } } + /* XXX - just call mutt_update_encoding? -tlr */ + mutt_set_encoding (att, info); mutt_stamp_attachment(att); + if (att->type == TYPETEXT) + mutt_set_body_charset(att, get_text_charset(att, info)); + #ifdef _PGPPATH /* * save the info in case this message is signed. we will want to do Q-P @@ -1092,8 +1097,6 @@ BODY *mutt_make_file_attach (const char *path) info = NULL; #endif - - safe_free ((void **) &info); return (att); @@ -1122,7 +1125,7 @@ BODY *mutt_make_multipart (BODY *b) new->type = TYPEMULTIPART; new->subtype = safe_strdup ("mixed"); new->encoding = get_toplevel_encoding (b); - mutt_generate_boundary(&new->parameter); + mutt_generate_boundary (&new->parameter); new->use_disp = 0; new->parts = b; |