coding style: Added braces even for one-line blocks
[mmh] / uip / rmm.c
index 0316c2c..4b1d7d3 100644 (file)
--- a/uip/rmm.c
+++ b/uip/rmm.c
@@ -13,7 +13,7 @@ static struct swit switches[] = {
 #define UNLINKSW  0
        { "unlink", 0 },
 #define NUNLINKSW  1
-       { "nounlink", 0 },
+       { "nounlink", 2 },
 #define VERSIONSW  2
        { "Version", 0 },
 #define HELPSW  3
@@ -33,10 +33,7 @@ main(int argc, char **argv)
        struct msgs *mp;
        pid_t pid;
 
-
-#ifdef LOCALE
        setlocale(LC_ALL, "");
-#endif
        invo_name = mhbasename(argv[0]);
 
        context_read();
@@ -71,35 +68,44 @@ main(int argc, char **argv)
                        }
                }
                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 */
 
 
@@ -128,16 +134,18 @@ main(int argc, char **argv)
        /* 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";