diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-09-22 18:13:12 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-09-22 18:13:12 +0000 |
commit | 44716e861e9c38c6771d2605e3c3b9db7ecc145a (patch) | |
tree | c9ecbf1d698fb4c9af56d0b0040e957fe9b4d09c /mx.c | |
parent | 940f31f67ffe4ec651c099c9bcd62b78d1189cc9 (diff) |
Some fixes and code clean-ups.
Diffstat (limited to 'mx.c')
-rw-r--r-- | mx.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -1144,10 +1144,9 @@ int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint) Sort = old_sort; } - /* save the old headers */ - old_msgcount = ctx->msgcount; - old_hdrs = ctx->hdrs; - + old_hdrs = NULL; + old_msgcount = 0; + /* simulate a close */ hash_destroy (&ctx->id_hash, NULL); hash_destroy (&ctx->subj_hash, NULL); @@ -1156,10 +1155,15 @@ int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint) { for (i = 0; i < ctx->msgcount; i++) mutt_free_header (&(ctx->hdrs[i])); /* nothing to do! */ - safe_free ((void **) &ctx->hdrs); + safe_free ((void **) &ctx->hdrs); } else + { + /* save the old headers */ + old_msgcount = ctx->msgcount; + old_hdrs = ctx->hdrs; ctx->hdrs = NULL; + } ctx->hdrmax = 0; /* force allocation of new headers */ ctx->msgcount = 0; |