( cvs diff -u -r 1.654.2.765 -r 1.654.2.766 configure.ac; cvs diff -u -r 1.14.2.8 -r 1.14.2.9 src/editaddress.c; cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/gedit-print.c; cvs diff -u -r 1.6.10.3 -r 1.6.10.4 src/mutt.c; cvs diff -u -r 1.1.4.3 -r 1.1.4.4 src/etpan/etpan-log.c; cvs diff -u -r 1.1.4.15 -r 1.1.4.16 src/etpan/imap-thread.c; cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/gtk/gtksourceprintjob.c; ) > 1.9.13cvs39.patchset
( cvs diff -u -r 1.204.2.51 -r 1.204.2.52 src/prefs_common.c; cvs diff -u -r 1.103.2.24 -r 1.103.2.25 src/prefs_common.h; cvs diff -u -r 1.22.2.11 -r 1.22.2.12 src/quote_fmt_parse.y; cvs diff -u -r 1.395.2.114 -r 1.395.2.115 src/summaryview.c; cvs diff -u -r 1.13.2.7 -r 1.13.2.8 src/plugins/clamav/clamav_plugin.c; cvs diff -u -r 1.12.2.4 -r 1.12.2.5 src/plugins/dillo_viewer/dillo_viewer.c; cvs diff -u -r 1.9.2.3 -r 1.9.2.4 src/plugins/mathml_viewer/mathml_viewer.c; cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/plugins/pgpcore/sgpgme.c; cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/plugins/pgpinline/pgpinline.c; cvs diff -u -r 1.1.2.21 -r 1.1.2.22 src/plugins/pgpmime/pgpmime.c; ) > 1.9.13cvs40.patchset
( cvs diff -u -r 1.382.2.152 -r 1.382.2.153 src/compose.c; cvs diff -u -r 1.204.2.52 -r 1.204.2.53 src/prefs_common.c; cvs diff -u -r 1.103.2.25 -r 1.103.2.26 src/prefs_common.h; cvs diff -u -r 1.1.2.6 -r 1.1.2.7 src/prefs_wrapping.c; ) > 1.9.13cvs41.patchset
+( cvs diff -u -r 1.382.2.153 -r 1.382.2.154 src/compose.c; cvs diff -u -r 1.49.2.54 -r 1.49.2.55 src/procmime.c; cvs diff -u -r 1.105.2.31 -r 1.105.2.32 src/prefs_account.c; ) > 1.9.13cvs42.patchset
gchar *content_type;
content_type = procmime_get_content_type_str(child->type, child->subtype);
- partname = procmime_mimeinfo_get_parameter(child, "name");
+ partname = procmime_mimeinfo_get_parameter(child, "filename");
+ if (partname == NULL)
+ partname = procmime_mimeinfo_get_parameter(child, "name");
if (partname == NULL)
partname = "";
compose_attach_append(compose, outfile,
ENC_AS_TOKEN,
ENC_AS_QUOTED_STRING,
ENC_AS_EXTENDED,
+ ENC_TO_ASCII,
} EncodeAs;
typedef struct _ParametersData {
FILE *fp;
guint len;
+ guint ascii_only;
} ParametersData;
static void write_parameters(gpointer key, gpointer value, gpointer user_data)
{
gchar *param = key;
- gchar *val = value, *valpos;
+ gchar *val = value, *valpos, *tmp;
ParametersData *pdata = (ParametersData *)user_data;
GString *buf = g_string_new("");
EncodeAs encas = ENC_AS_TOKEN;
for (valpos = val; *valpos != 0; valpos++) {
- if (!IS_ASCII(*valpos)) {
+ if (!IS_ASCII(*valpos) || *valpos == '"') {
encas = ENC_AS_EXTENDED;
break;
}
case ';':
case ':':
case '\\':
- case '"':
+ case '\'':
case '/':
case '[':
case ']':
continue;
}
}
+
+ if (encas == ENC_AS_EXTENDED && pdata->ascii_only == TRUE)
+ encas = ENC_TO_ASCII;
switch (encas) {
case ENC_AS_TOKEN:
g_string_append_printf(buf, "%s=%s", param, val);
break;
+ case ENC_TO_ASCII:
+ tmp = g_strdup(val);
+ g_strcanon(tmp,
+ " ()<>@,';:\\/[]?=.0123456789"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "abcdefghijklmnopqrstuvwxyz",
+ '_');
+ g_string_append_printf(buf, "%s=\"%s\"", param, tmp);
+ g_free(tmp);
+ break;
+
case ENC_AS_QUOTED_STRING:
g_string_append_printf(buf, "%s=\"%s\"", param, val);
break;
g_string_append_printf(buf, "%%%s", hexstr);
}
}
- break;
+ break;
}
if (buf->str && strlen(buf->str)) {
debug_print("procmime_write_mime_header\n");
pdata->fp = fp;
+ pdata->ascii_only = FALSE;
for (type_table = mime_type_table; type_table->str != NULL; type_table++)
if (mimeinfo->type == type_table->type) {
"Content-Type: %s/%s", type_table->str, mimeinfo->subtype);
fprintf(fp, "%s", buf);
pdata->len = strlen(buf);
+ pdata->ascii_only = TRUE;
g_free(buf);
break;
}
g_free(buf);
pdata->fp = fp;
+ pdata->ascii_only = FALSE;
+
g_hash_table_foreach(mimeinfo->dispositionparameters, write_parameters, pdata);
g_free(pdata);
fprintf(fp, "\n");