]> diplodocus.org Git - nmh/blob - sbr/seq_setprev.c
Escape literal leading full stop in man/new.man.
[nmh] / sbr / seq_setprev.c
1
2 /*
3 * seq_setprev.c -- set the Previous-Sequence
4 *
5 * This code is Copyright (c) 2002, by the authors of nmh. See the
6 * COPYRIGHT file in the root directory of the nmh distribution for
7 * complete copyright information.
8 */
9
10 #include <h/mh.h>
11 #include <h/utils.h>
12
13 /*
14 * Add all the messages currently SELECTED to
15 * the Previous-Sequence. This way, when the next
16 * command is given, there is a convenient way to
17 * selected all the messages used in the previous
18 * command.
19 */
20
21 void
22 seq_setprev (struct msgs *mp)
23 {
24 char **ap, *cp, *dp;
25
26 /*
27 * Get the list of sequences for Previous-Sequence
28 * and split them.
29 */
30 if ((cp = context_find (psequence))) {
31 dp = mh_xstrdup(cp);
32 if (!(ap = brkstring (dp, " ", "\n")) || !*ap) {
33 free (dp);
34 return;
35 }
36 } else {
37 return;
38 }
39
40 /* Now add all SELECTED messages to each sequence */
41 for (; *ap; ap++)
42 seq_addsel (mp, *ap, -1, 1);
43
44 free (dp);
45 }