Skip to content

Avoid segfault when all messages are excluded - fixes #29 #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 27 additions & 23 deletions src/hypermail.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ int main(int argc, char **argv)
}
if (set_increment) {
int num_displayable;
int num_added;
if (set_linkquotes)
replylist = NULL;
/* we have to start with the msgnum - 1 so that the rest of the
Expand All @@ -613,29 +614,32 @@ int main(int argc, char **argv)
amount_old = max_msgnum + 1; /* counts gaps as messages */

/* start numbering at this number */
amount_new = num_displayable + parsemail(set_mbox, use_stdin, set_readone, set_increment, set_dir, set_inlinehtml, amount_old);
if (set_linkquotes)
analyze_headers(max_msgnum + 1);

/* write the index of msgno/msgid_hash filenames */
if (set_nonsequential)
write_messageindex(0, max_msgnum + 1);

writearticles(amount_old, max_msgnum + 1);

/* JK: in function of other hypermail configuration options,
delete_incremental will continuous escape and add more markup
to non-deleted messages that are replies to deleted messages.
Thus, a setup option to disable it */
if (set_delete_incremental && deletedlist)
update_deletions(amount_old);

if (set_show_msg_links) {
fixnextheader(set_dir, amount_old, -1);
for (i = amount_old; i <= max_msgnum; ++i) {
if (set_showreplies)
fixreplyheader(set_dir, i, 0, amount_old);
fixthreadheader(set_dir, i, amount_old);
num_added = parsemail(set_mbox, use_stdin, set_readone, set_increment, set_dir, set_inlinehtml, amount_old);
if (num_added > 0) {
amount_new = num_displayable + num_added;
if (set_linkquotes)
analyze_headers(max_msgnum + 1);

/* write the index of msgno/msgid_hash filenames */
if (set_nonsequential)
write_messageindex(0, max_msgnum + 1);

writearticles(amount_old, max_msgnum + 1);

/* JK: in function of other hypermail configuration options,
delete_incremental will continuous escape and add more markup
to non-deleted messages that are replies to deleted messages.
Thus, a setup option to disable it */
if (set_delete_incremental && deletedlist)
update_deletions(amount_old);

if (set_show_msg_links) {
fixnextheader(set_dir, amount_old, -1);
for (i = amount_old; i <= max_msgnum; ++i) {
if (set_showreplies)
fixreplyheader(set_dir, i, 0, amount_old);
fixthreadheader(set_dir, i, amount_old);
}
}
}
}
Expand Down