Replaced open_form() with new_fs() for the last time and dropped the function.
[mmh] / uip / dist.c
index 52e480e..39d6525 100644 (file)
@@ -45,6 +45,7 @@ main(int argc, char **argv)
        char *form = NULL, *msg = NULL, buf[BUFSIZ], drft[BUFSIZ];
        char **argp, **arguments;
        struct msgs *mp = NULL;
+       char *nfs;
 
 #ifdef LOCALE
        setlocale(LC_ALL, "");
@@ -134,15 +135,14 @@ main(int argc, char **argv)
        if (file && (msg || folder))
                adios(NULL, "can't mix files and folders/msgs");
 
-       in = open_form(&form, distcomps);
-
        strncpy(drft, m_draft(seq_beyond), sizeof(drft));
-
        if ((out = creat(drft, m_gmprot())) == NOTOK)
                adios(drft, "unable to create");
 
-       cpydata(in, out, form, drft);
-       close(in);
+       nfs = new_fs(form, NULL, distcomps, NULL);
+       if (write(out, nfs, strlen(nfs)) != strlen(nfs)) {
+               adios(drft, "error writing");
+       }
        close(out);
 
        if (file) {