# HG changeset patch # User Timo Sirainen # Date 1174839969 -10800 # Node ID c7a3410a8f1f56b71860cb22300aa3b675d0a9e2 # Parent 72c91dc78fadf8061ec4117d7dc6ddd3002b76eb Crashfix diff -r 72c91dc78fad -r c7a3410a8f1f src/lib-storage/index/maildir/maildir-save.c --- a/src/lib-storage/index/maildir/maildir-save.c Sun Mar 25 19:21:09 2007 +0300 +++ b/src/lib-storage/index/maildir/maildir-save.c Sun Mar 25 19:26:09 2007 +0300 @@ -229,12 +229,20 @@ if (mail_set_seq(dest_mail, ctx->seq) < 0) i_unreached(); - tee = tee_i_stream_create(ctx->input, default_pool); - ctx->input = tee_i_stream_create_child(tee, default_pool); - ctx->input2 = tee_i_stream_create_child(tee, default_pool); + if (ctx->input == NULL) { + /* FIXME: copying with hardlinking. we could copy the + cached data directly */ + ctx->cur_dest_mail = 0; + } else { + tee = tee_i_stream_create(ctx->input, default_pool); + ctx->input = + tee_i_stream_create_child(tee, default_pool); + ctx->input2 = + tee_i_stream_create_child(tee, default_pool); - index_mail_cache_parse_init(dest_mail, ctx->input2); - ctx->cur_dest_mail = dest_mail; + index_mail_cache_parse_init(dest_mail, ctx->input2); + ctx->cur_dest_mail = dest_mail; + } } else { ctx->seq = 0; ctx->cur_dest_mail = NULL;