Before this patch, if +inbox is empty, following error happened:
$ inc -file - < /dev/null
Incorporating new mail into inbox...
inc: no messages incorporated, continuing...
inc: Bug: message out of bounds
This happened due improper call to `seq_setunseen', which implicitly
assumed that there is at least one message (it does not handle case
where both mp->hghmsg and mh->lowmsg are 0).
Bug does not happens with command `inc -file empty', since file
is checked for being empty before any read attempts.
Signed-off-by: Dmitry Bogatov <KAction@gnu.org>
int n;
char **ap, *cp, *dp;
+ if (mp->lowmsg == 0) {
+ return;
+ }
+
/*
** Get the list of sequences for Unseen-Sequence
** and split them.
!
rm "$f"
unset f
+
+runandcheck "folder +inc-testfolder" <<!
+inc-testfolder+ has no messages
+!
+
+runandcheck "inc +inc-testfolder -file - < /dev/null" <<!
+Incorporating new mail into inc-testfolder...
+
+inc: no messages incorporated, continuing...
+!