From: Colin Leroy Date: Thu, 21 Oct 2004 09:19:57 +0000 (+0000) Subject: 2004-10-21 [colin] 0.9.12cvs131 X-Git-Tag: rel_0_9_13~76 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=970b6348bf1879840dbf4478296f7e2388584fcc 2004-10-21 [colin] 0.9.12cvs131 * src/compose.c Replace "unknown" attachments by "application/octet-stream" Be a bit more defensive when using strchr --- diff --git a/ChangeLog.claws b/ChangeLog.claws index 95ac4323b..403c5dea2 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,9 @@ +2004-10-21 [colin] 0.9.12cvs131 + + * src/compose.c + Replace "unknown" attachments by "application/octet-stream" + Be a bit more defensive when using strchr + 2004-10-20 [paul] * po/ru.po diff --git a/PATCHSETS b/PATCHSETS index 4391166b8..b63b11c88 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -113,3 +113,4 @@ ( cvs diff -u -r 1.1 -r 1.2 src/plugins/pgpmime/passphrase.c; cvs diff -u -r 1.6 -r 1.7 src/plugins/pgpmime/pgpmime.c; cvs diff -u -r 1.1 -r 1.2 src/plugins/pgpmime/prefs_gpg.c; cvs diff -u -r 0 -r 1 src/plugins/pgpmime/prefs_gpg.glade; cvs diff -u -r 1.1 -r 1.2 src/plugins/pgpmime/prefs_gpg.h; cvs diff -u -r 1.4 -r 1.5 src/plugins/pgpmime/sgpgme.c; ) > 0.9.12cvs128.patchset ( cvs diff -u -r 1.446 -r 1.447 src/compose.c; cvs diff -u -r 1.54 -r 1.55 src/common/utils.c; ) > 0.9.12cvs129.patchset ( cvs diff -u -r 1.447 -r 1.448 src/compose.c; cvs diff -u -r 1.9 -r 1.10 src/gtk/menu.c; ) > 0.9.12cvs130.patchset +( cvs diff -u -r 1.448 -r 1.449 src/compose.c; ) > 0.9.12cvs131.patchset diff --git a/configure.ac b/configure.ac index cd97272a5..87dfd4e43 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=12 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=130 +EXTRA_VERSION=131 EXTRA_RELEASE= if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then diff --git a/src/compose.c b/src/compose.c index a2a6f7522..f16ba41cc 100644 --- a/src/compose.c +++ b/src/compose.c @@ -2176,6 +2176,12 @@ static void compose_attach_append(Compose *compose, const gchar *file, ainfo->encoding = ENC_BASE64; ainfo->name = g_strdup(g_basename(filename ? filename : file)); } + + if (!strcmp(ainfo->content_type, "unknown")) { + g_free(ainfo->content_type); + ainfo->content_type = g_strdup("application/octet-stream"); + } + ainfo->size = size; text[COL_MIMETYPE] = ainfo->content_type; @@ -3750,6 +3756,12 @@ static void compose_add_attachments(Compose *compose, MimeInfo *parent) mimepart->length = statbuf.st_size; type = g_strdup(ainfo->content_type); + + if (!strchr(type, '/')) { + g_free(type); + type = g_strdup("application/octet-stream"); + } + subtype = strchr(type, '/') + 1; *(subtype - 1) = '\0'; mimepart->type = procmime_get_media_type(type);