- if (!(mp = folder_read(folder)))
- adios(NULL, "unable to read folder %s", folder);
-
- /* check for empty folder */
- if (mp->nummsg == 0)
- adios(NULL, "no messages in %s", folder);
-
- /* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < msgs.size; msgnum++)
- if (!m_convert(mp, msgs.msgs[msgnum]))
- done(1);
- seq_setprev(mp); /* set the previous-sequence */
+ if (!(mp = folder_read(folder))) {
+ adios(EX_IOERR, NULL, "unable to read folder %s", folder);
+ }
+ if (mp->nummsg == 0) {
+ adios(EX_DATAERR, NULL, "no messages in %s", folder);
+ }
+ /*
+ ** parse all the message ranges/sequences and set SELECTED
+ ** (We do this for the refiling case as well, to complain
+ ** about invalid msg arguments in rmm, before we call refile.)
+ */
+ for (msgnum = 0; msgnum < msgs.size; msgnum++) {
+ if (!m_convert(mp, msgs.msgs[msgnum])) {
+ exit(EX_USAGE);
+ }
+ }