bp = buffer;
- for (i = mp->lowmsg; i <= mp->hghmsg; ++i) {
- /*
- ** If message doesn't exist, or isn't in
- ** the sequence, then continue.
- */
- if (!does_exist(mp, i) || !in_sequence(mp, seqnum, i))
+ for (i = mp->lowoff; i <= mp->hghoff; ++i) {
+ /* If message isn't in the sequence, then continue */
+ if (!in_sequence(mp, seqnum, i))
continue;
/*
/*
** Scan to the end of this message range
*/
- for (++i; i <= mp->hghmsg && does_exist(mp, i) &&
- in_sequence(mp, seqnum, i); ++i)
+ for (++i; i <= mp->hghoff && in_sequence(mp, seqnum, i); ++i)
;
if (i - j > 1) {
** We iterate through messages in this range
** and flip on bit for this sequence.
*/
+ if (k > mp->hghoff) {
+ if (!(mp = folder_realloc(mp, mp->lowoff, k))) {
+ adios(EX_OSERR, NULL, "unable to allocate folder storage");
+ }
+ mp->hghoff = k;
+ }
for (; j <= k; j++) {
- if (j >= mp->lowmsg && j <= mp->hghmsg &&
- does_exist(mp, j))
+ if (j >= mp->lowmsg && j <= mp->hghoff)
add_sequence(mp, i, j);
}
}