X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fseq_setunseen.c;h=a115564345c1dee2eee7efd5eddd93b9b885aae9;hp=ea18d176d30344e60efbd1cf90e2caf1efdc7be9;hb=a485ed478abbd599d8c9aab48934e7a26733ecb1;hpb=5dd6771b28c257af405d7248639ed0e3bcdce38b diff --git a/sbr/seq_setunseen.c b/sbr/seq_setunseen.c index ea18d17..a115564 100644 --- a/sbr/seq_setunseen.c +++ b/sbr/seq_setunseen.c @@ -1,4 +1,3 @@ - /* * seq_setunseen.c -- add/delete all messages which have the SELECT_UNSEEN * -- bit set to/from the Unseen-Sequence @@ -21,40 +20,40 @@ void seq_setunseen (struct msgs *mp, int seen) { - int msgnum; - char **ap, *cp, *dp; + int msgnum; + char **ap, *cp, *dp; - /* - * Get the list of sequences for Unseen-Sequence - * and split them. - */ - if ((cp = context_find (usequence))) { - dp = getcpy (cp); - if (!(ap = brkstring (dp, " ", "\n")) || !*ap) { - free (dp); - return; + /* + * Get the list of sequences for Unseen-Sequence + * and split them. + */ + if ((cp = context_find (usequence))) { + dp = getcpy (cp); + if (!(ap = brkstring (dp, " ", "\n")) || !*ap) { + free (dp); + return; + } + } else { + return; } - } else { - return; - } - /* - * Now add/delete each message which has the SELECT_UNSEEN - * bit set to/from each of these sequences. - */ - for (; *ap; ap++) { - if (seen) { - /* make sure sequence exists first */ - if (seq_getnum(mp, *ap) != -1) - for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) - if (is_unseen (mp, msgnum)) - seq_delmsg (mp, *ap, msgnum); - } else { - for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) - if (is_unseen (mp, msgnum)) - seq_addmsg (mp, *ap, msgnum, -1, 0); + /* + * Now add/delete each message which has the SELECT_UNSEEN + * bit set to/from each of these sequences. + */ + for (; *ap; ap++) { + if (seen) { + /* make sure sequence exists first */ + if (seq_getnum(mp, *ap) != -1) + for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) + if (is_unseen (mp, msgnum)) + seq_delmsg (mp, *ap, msgnum); + } else { + for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) + if (is_unseen (mp, msgnum)) + seq_addmsg (mp, *ap, msgnum, -1, 0); + } } - } - free (dp); + free (dp); }