}
}
if (*cp == '+' || *cp == '@') {
- if (folder)
+ if (folder) {
adios(NULL, "only one folder at a time!");
- else
+ } else {
folder = getcpy(expandfol(cp));
- } else
+ }
+ } else {
app_msgarg(&msgs, cp);
+ }
}
- if (!msgs.size)
+ if (!msgs.size) {
app_msgarg(&msgs, seq_cur);
- if (!folder)
+ }
+ if (!folder) {
folder = getcurfol();
+ }
maildir = toabsdir(folder);
- if (chdir(maildir) == NOTOK)
+ if (chdir(maildir) == NOTOK) {
adios(maildir, "unable to change directory to");
+ }
/* read folder and create message structure */
- if (!(mp = folder_read(folder)))
+ if (!(mp = folder_read(folder))) {
adios(NULL, "unable to read folder %s", folder);
+ }
/* check for empty folder */
- if (mp->nummsg == 0)
+ 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]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++) {
+ if (!m_convert(mp, msgs.msgs[msgnum])) {
done(1);
+ }
+ }
seq_setprev(mp); /* set the previous-sequence */
/* remove by refiling. */
/* Unset the EXISTS flag for each message to be removed */
for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
- if (is_selected(mp, msgnum))
+ if (is_selected(mp, msgnum)) {
unset_exists(mp, msgnum);
+ }
}
/* Mark that the sequence information has changed */
mp->msgflags |= SEQMOD;
- if (mp->numsel+4 > MAXARGS)
+ if (mp->numsel+4 > MAXARGS) {
adios(NULL, "more than %d messages for refile exec",
MAXARGS - 4);
+ }
vec = (char **)mh_xmalloc((size_t)(mp->numsel + 4) * sizeof(*vec));
vec[vecp++] = "refile";
vec[vecp++] = "-nolink";