* uip/mhlistsbr.c, uip/mhlsbr.c, uip/picksbr.c: cast
[mmh] / uip / dist.c
index 4b6ce69..1effbb0 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <h/mh.h>
+#include <h/utils.h>
 #include <fcntl.h>
 
 static struct swit switches[] = {
@@ -179,7 +180,7 @@ main (int argc, char **argv)
            if (folder)
                adios (NULL, "only one folder at a time!");
            else
-               folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
+               folder = pluspath (cp);
        } else {
            if (msg)
                adios (NULL, "only one message at a time!");
@@ -195,14 +196,7 @@ main (int argc, char **argv)
     if (file && (msg || folder))
        adios (NULL, "can't mix files and folders/msgs");
 
-    if (form) {
-       if ((in = open (etcpath (form), O_RDONLY)) == NOTOK)
-           adios (form, "unable to open form file");
-    } else {
-       if ((in = open (etcpath (distcomps), O_RDONLY)) == NOTOK)
-           adios (distcomps, "unable to open default components file");
-       form = distcomps;
-    }
+    in = open_form(&form, distcomps);
 
 try_it_again:
     strncpy (drft, m_draft (dfolder, dmsg, NOUSE, &isdf), sizeof(drft));
@@ -291,5 +285,6 @@ try_it_again:
        done (0);
     what_now (ed, nedit, NOUSE, drft, msgnam, 1, mp,
        anot ? "Resent" : NULL, inplace, cwd);
-    return done (1);
+    done (1);
+    return 1;
 }