changeset 82:438d5f258b01 HEAD

maybe now?
author Timo Sirainen <tss@iki.fi>
date Wed, 28 Aug 2002 23:59:40 +0300
parents 1dfa3c9d60ef
children a437489953da
files src/lib-index/mbox/mbox-append.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mbox/mbox-append.c	Wed Aug 28 23:57:49 2002 +0300
+++ b/src/lib-index/mbox/mbox-append.c	Wed Aug 28 23:59:40 2002 +0300
@@ -96,7 +96,7 @@
 	MailIndexUpdate *update;
         MboxHeaderContext ctx;
 	time_t internal_date;
-	uoff_t start_offset, stop_offset, old_size;
+	uoff_t abs_start_offset, stop_offset, old_size;
 	unsigned char *data, md5_digest[16];
 	unsigned int size, pos, virtual_size;
 	const char *location;
@@ -129,7 +129,7 @@
 		internal_date = ioloop_time;
 
 	io_buffer_skip(inbuf, pos+1);
-	start_offset = inbuf->start_offset + inbuf->offset;
+	abs_start_offset = inbuf->start_offset + inbuf->offset;
 
 	/* now, find the ending "[\r]\nFrom " */
 	mbox_read_message(inbuf, &virtual_size);
@@ -143,8 +143,8 @@
 	update = index->update_begin(index, rec);
 
 	/* location = offset to beginning of message */
-	location = binary_to_hex((unsigned char *) &start_offset,
-				 sizeof(start_offset));
+	location = binary_to_hex((unsigned char *) &abs_start_offset,
+				 sizeof(abs_start_offset));
 	index->update_field(update, FIELD_TYPE_LOCATION, location, 0);
 
 	/* parse the header and cache wanted fields. get the message flags
@@ -155,7 +155,7 @@
 
         old_size = inbuf->size;
 	inbuf->size = stop_offset;
-	io_buffer_seek(inbuf, start_offset);
+	io_buffer_seek(inbuf, abs_start_offset - inbuf->start_offset);
 
 	mail_index_update_headers(update, inbuf, 0, mbox_header_func, &ctx);