This allows better handling of raceconditions, like a new mail gets
deliverd while a unreed mail is shown.
- 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))
/*
** Scan to the end of this message range
*/
/*
** 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)
** We iterate through messages in this range
** and flip on bit for this sequence.
*/
** 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;
+ }
- if (j >= mp->lowmsg && j <= mp->hghmsg &&
- does_exist(mp, j))
+ if (j >= mp->lowmsg && j <= mp->hghoff)
add_sequence(mp, i, j);
}
}
add_sequence(mp, i, j);
}
}
-mark -sequence u -add -nozero 10
+
+#add a new mail
+rcvstore <<!
+From: test
+To: test
+
+testmail
+!
runandcheck "pick u" <<!
1
2
runandcheck "pick u" <<!
1
2
!
pkill -P $pagerpid
wait $pagerpid
runandcheck "pick u" <<!
9
!
pkill -P $pagerpid
wait $pagerpid
runandcheck "pick u" <<!
9