25 |
int |
int |
26 |
mail_next (int argc, char **argv) |
mail_next (int argc, char **argv) |
27 |
{ |
{ |
28 |
|
size_t n; |
29 |
|
message_t msg; |
30 |
|
|
31 |
if (argc < 2) |
if (argc < 2) |
32 |
{ |
{ |
33 |
if (cursor < total) |
int rc = 1; |
34 |
|
for (n = cursor + 1; n <= total; n++) |
35 |
{ |
{ |
36 |
cursor++; |
rc = util_get_message (mbox, n, &msg, MSG_NODELETED|MSG_SILENT); |
37 |
realcursor++; |
if (rc == 0) |
38 |
|
break; |
39 |
|
} |
40 |
|
|
41 |
|
if (rc) |
42 |
|
{ |
43 |
|
util_error ("No applicable message"); |
44 |
|
return 1; |
45 |
} |
} |
46 |
} |
} |
47 |
else |
else |
48 |
{ |
{ |
49 |
msgset_t *list = NULL; |
msgset_t *list = NULL; |
50 |
msgset_parse (argc, argv, &list); |
msgset_parse (argc, argv, &list); |
51 |
cursor = list->msg_part[0]; |
n = list->msg_part[0]; |
|
realcursor = cursor; |
|
52 |
msgset_free (list); |
msgset_free (list); |
53 |
|
if (util_get_message (mbox, n, &msg, MSG_NODELETED|MSG_SILENT)) |
54 |
|
return 1; |
55 |
} |
} |
56 |
|
cursor = realcursor = n; |
57 |
util_do_command("print"); |
util_do_command("print"); |
58 |
return 0; |
return 0; |
59 |
} |
} |