aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-06-16 01:52:06 +0800
committerDan Winship <danw@src.gnome.org>2000-06-16 01:52:06 +0800
commitf3e0d87b42f7b957b5e37a7995ea4550770c3928 (patch)
treeb869da599f87c6415846fbab5b72e45e38d138a7 /camel
parent94f0df746e8ca9782879646c4c256e829cc9421d (diff)
downloadgsoc2013-evolution-f3e0d87b42f7b957b5e37a7995ea4550770c3928.tar.gz
gsoc2013-evolution-f3e0d87b42f7b957b5e37a7995ea4550770c3928.tar.zst
gsoc2013-evolution-f3e0d87b42f7b957b5e37a7995ea4550770c3928.zip
Fix to previous change: make sure the "seek" variable ends up with the
* providers/mbox/camel-mbox-folder.c (mbox_append_message): Fix to previous change: make sure the "seek" variable ends up with the value it should. * providers/mbox/camel-mbox-summary.c (summary_rebuild): Update summary mtime as well as size. svn path=/trunk/; revision=3577
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog9
-rw-r--r--camel/providers/mbox/camel-mbox-folder.c7
-rw-r--r--camel/providers/mbox/camel-mbox-summary.c14
3 files changed, 23 insertions, 7 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 533f243df5..4daf3f466c 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,12 @@
+2000-06-15 Dan Winship <danw@helixcode.com>
+
+ * providers/mbox/camel-mbox-folder.c (mbox_append_message): Fix to
+ previous change: make sure the "seek" variable ends up with the
+ value it should.
+
+ * providers/mbox/camel-mbox-summary.c (summary_rebuild): Update
+ summary mtime as well as size.
+
2000-06-14 Dan Winship <danw@helixcode.com>
* providers/mbox/camel-mbox-folder.c (mbox_append_message): if the
diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c
index 035dbee127..0aa2f90f26 100644
--- a/camel/providers/mbox/camel-mbox-folder.c
+++ b/camel/providers/mbox/camel-mbox-folder.c
@@ -298,7 +298,7 @@ mbox_append_message (CamelFolder *folder, CamelMimeMessage *message, CamelExcept
CamelStream *output_stream = NULL, *filter_stream = NULL;
CamelMimeFilter *filter_from = NULL;
struct stat st;
- off_t seek = -1;
+ off_t seek;
char *xev, last;
guint32 uid;
@@ -311,7 +311,7 @@ mbox_append_message (CamelFolder *folder, CamelMimeMessage *message, CamelExcept
if (st.st_size) {
seek = camel_seekable_stream_seek((CamelSeekableStream *)output_stream, st.st_size - 1, SEEK_SET);
- if (seek != st.st_size - 1)
+ if (++seek != st.st_size)
goto fail;
/* If the mbox doesn't end with a newline, fix that. */
@@ -319,7 +319,8 @@ mbox_append_message (CamelFolder *folder, CamelMimeMessage *message, CamelExcept
goto fail;
if (last != '\n')
camel_stream_write (output_stream, "\n", 1);
- }
+ } else
+ seek = 0;
/* assign a new x-evolution header/uid */
camel_medium_remove_header((CamelMedium *)message, "X-Evolution");
diff --git a/camel/providers/mbox/camel-mbox-summary.c b/camel/providers/mbox/camel-mbox-summary.c
index c2fd326104..03f2f2f250 100644
--- a/camel/providers/mbox/camel-mbox-summary.c
+++ b/camel/providers/mbox/camel-mbox-summary.c
@@ -273,6 +273,7 @@ static int message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageIn
static int
summary_rebuild(CamelMboxSummary *mbs, off_t offset)
{
+ CamelFolderSummary *s = (CamelFolderSummary *)mbs;
CamelMimeParser *mp;
int fd;
int ok = 0;
@@ -317,11 +318,16 @@ summary_rebuild(CamelMboxSummary *mbs, off_t offset)
g_assert(camel_mime_parser_step(mp, NULL, NULL) == HSCAN_FROM_END);
}
- /* update the file size in the summary */
- if (ok != -1)
- mbs->folder_size = camel_mime_parser_seek(mp, 0, SEEK_CUR);
- printf("updating folder size = %d\n", mbs->folder_size);
gtk_object_unref((GtkObject *)mp);
+ /* update the file size/mtime in the summary */
+ if (ok != -1) {
+ struct stat st;
+
+ if (stat (mbs->folder_path, &st) == 0) {
+ mbs->folder_size = st.st_size;
+ s->time = st.st_mtime;
+ }
+ }
return ok;
}