aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-07-07 01:05:56 +0800
committerDan Winship <danw@src.gnome.org>2000-07-07 01:05:56 +0800
commit7ce3b0a7290417c35721fa4850a0d06875109e40 (patch)
tree123a2211233137234d152b42ef4eebc7f3edf7ea /mail
parentd3e03fac93f26acd6572689c1553749f46ebad79 (diff)
downloadgsoc2013-evolution-7ce3b0a7290417c35721fa4850a0d06875109e40.tar
gsoc2013-evolution-7ce3b0a7290417c35721fa4850a0d06875109e40.tar.gz
gsoc2013-evolution-7ce3b0a7290417c35721fa4850a0d06875109e40.tar.bz2
gsoc2013-evolution-7ce3b0a7290417c35721fa4850a0d06875109e40.tar.lz
gsoc2013-evolution-7ce3b0a7290417c35721fa4850a0d06875109e40.tar.xz
gsoc2013-evolution-7ce3b0a7290417c35721fa4850a0d06875109e40.tar.zst
gsoc2013-evolution-7ce3b0a7290417c35721fa4850a0d06875109e40.zip
Add a workaround for a small gnome-vfs 0.2 bug so we don't need to require
* mail-identify.c: Add a workaround for a small gnome-vfs 0.2 bug so we don't need to require CVS gnome-vfs. svn path=/trunk/; revision=3924
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-identify.c26
2 files changed, 31 insertions, 0 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index bf099dac12..2e584bcdbe 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2000-07-06 Dan Winship <danw@helixcode.com>
+
+ * mail-identify.c: Add a workaround for a small gnome-vfs 0.2 bug
+ so we don't need to require CVS gnome-vfs.
+
2000-07-06 Not Zed <NotZed@HelixCode.com>
* message-thread.c (sort_thread): sort messages based on date for
diff --git a/mail/mail-identify.c b/mail/mail-identify.c
index f8c7f65231..ba8a943f38 100644
--- a/mail/mail-identify.c
+++ b/mail/mail-identify.c
@@ -32,6 +32,20 @@
#include <libgnomevfs/gnome-vfs-mime-sniff-buffer.h>
#include "mail.h"
+/* gnome-vfs 0.2 has a bug that makes memory-based sniff buffers cause
+ * segfaults sometimes. It's fixed in CVS, but we'll work around it for
+ * now until gnome-vfs 0.3 comes out.
+ */
+#define GNOME_VFS_0_2_WORKAROUND
+
+#ifdef GNOME_VFS_0_2_WORKAROUND
+#include <libgnomevfs/gnome-vfs-mime-sniff-buffer-private.h>
+
+static GnomeVFSResult sniffer_seek (gpointer context,
+ GnomeVFSSeekPosition whence,
+ GnomeVFSFileOffset offset);
+#endif
+
/**
* mail_identify_mime_part:
* @part: a CamelMimePart
@@ -80,6 +94,9 @@ mail_identify_mime_part (CamelMimePart *part)
if (ba->len) {
sniffer = gnome_vfs_mime_sniff_buffer_new_from_memory (
ba->data, ba->len);
+#ifdef GNOME_VFS_0_2_WORKAROUND
+ sniffer->seek = sniffer_seek;
+#endif
type = gnome_vfs_get_mime_type_for_buffer (sniffer);
gnome_vfs_mime_sniff_buffer_free (sniffer);
} else
@@ -99,3 +116,12 @@ mail_identify_mime_part (CamelMimePart *part)
/* We give up. */
return NULL;
}
+
+#ifdef GNOME_VFS_0_2_WORKAROUND
+static GnomeVFSResult
+sniffer_seek (gpointer context, GnomeVFSSeekPosition whence,
+ GnomeVFSFileOffset offset)
+{
+ return GNOME_VFS_ERROR_EOF;
+}
+#endif