]> diplodocus.org Git - nmh/blobdiff - uip/comp.c
- Fixed bcc to work with sendmail/pipe [Bug 55700].
[nmh] / uip / comp.c
index 1aba2808cc32045c7b5e05916799e7658eedecc7..69210f81ed0437515fad73dc2a12ff0d17f7f864 100644 (file)
@@ -5,9 +5,33 @@
  * complete copyright information.
  */
 
  * complete copyright information.
  */
 
-#include <h/mh.h>
-#include <h/utils.h>
-#include <h/fmt_scan.h>
+#include "h/mh.h"
+#include "sbr/fmt_new.h"
+#include "whatnowproc.h"
+#include "sbr/m_name.h"
+#include "sbr/m_gmprot.h"
+#include "sbr/getarguments.h"
+#include "sbr/read_switch_multiword.h"
+#include "sbr/seq_setprev.h"
+#include "sbr/seq_save.h"
+#include "sbr/showfile.h"
+#include "sbr/smatch.h"
+#include "sbr/refile.h"
+#include "sbr/cpydata.h"
+#include "sbr/m_draft.h"
+#include "sbr/m_convert.h"
+#include "sbr/getfolder.h"
+#include "sbr/fdcompare.h"
+#include "sbr/folder_read.h"
+#include "sbr/context_save.h"
+#include "sbr/context_find.h"
+#include "sbr/ambigsw.h"
+#include "sbr/path.h"
+#include "sbr/print_version.h"
+#include "sbr/print_help.h"
+#include "sbr/error.h"
+#include "h/utils.h"
+#include "h/fmt_scan.h"
 #include "h/done.h"
 #include "sbr/m_maildir.h"
 #include <fcntl.h>
 #include "h/done.h"
 #include "sbr/m_maildir.h"
 #include <fcntl.h>
@@ -70,7 +94,10 @@ static struct swit aqrul[] = {
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int use = NOUSE, nedit = 0, nwhat = 0, build = 0;
+    int use = NOUSE;
+    bool nedit = false;
+    bool nwhat = false;
+    bool build = false;
     int i, in = NOTOK, isdf = 0, out, dat[5], format_len = 0;
     int outputlinelen = OUTPUTLINELEN;
     char *cp, *cwd, *maildir, *dfolder = NULL;
     int i, in = NOTOK, isdf = 0, out, dat[5], format_len = 0;
     int outputlinelen = OUTPUTLINELEN;
     char *cp, *cwd, *maildir, *dfolder = NULL;
@@ -109,23 +136,23 @@ main (int argc, char **argv)
                case EDITRSW: 
                    if (!(ed = *argp++) || *ed == '-')
                        die("missing argument to %s", argp[-2]);
                case EDITRSW: 
                    if (!(ed = *argp++) || *ed == '-')
                        die("missing argument to %s", argp[-2]);
-                   nedit = 0;
+                   nedit = false;
                    continue;
                case NEDITSW: 
                    continue;
                case NEDITSW: 
-                   nedit++;
+                   nedit = true;
                    continue;
 
                case WHATSW: 
                    if (!(whatnowproc = *argp++) || *whatnowproc == '-')
                        die("missing argument to %s", argp[-2]);
                    continue;
 
                case WHATSW: 
                    if (!(whatnowproc = *argp++) || *whatnowproc == '-')
                        die("missing argument to %s", argp[-2]);
-                   nwhat = 0;
+                   nwhat = false;
                    continue;
 
                case BILDSW:
                    continue;
 
                case BILDSW:
-                   build++;
+                   build = true;
                    /* FALLTHRU */
                case NWHATSW: 
                    /* FALLTHRU */
                case NWHATSW: 
-                   nwhat++;
+                   nwhat = true;
                    continue;
 
                case FORMSW: 
                    continue;
 
                case FORMSW: 
@@ -140,7 +167,7 @@ main (int argc, char **argv)
                    use = NOUSE;
                    continue;
 
                    use = NOUSE;
                    continue;
 
-               case FILESW:    /* compatibility */
+               case FILESW:    /* compatibility */
                    if (file)
                        die("only one file at a time!");
                    if (!(file = *argp++) || *file == '-')
                    if (file)
                        die("only one file at a time!");
                    if (!(file = *argp++) || *file == '-')
@@ -273,7 +300,7 @@ main (int argc, char **argv)
     } else {
        struct comp *cptr;
 
     } else {
        struct comp *cptr;
 
-       if (! form)
+       if (! form)
            form = components;
 
         cp = new_fs(form, NULL, NULL);
            form = components;
 
         cp = new_fs(form, NULL, NULL);
@@ -287,33 +314,33 @@ main (int argc, char **argv)
        if (from) {
            cptr = fmt_findcomp("from");
            if (cptr)
        if (from) {
            cptr = fmt_findcomp("from");
            if (cptr)
-               cptr->c_text = from;
+               cptr->c_text = from;
        }
        if (to) {
            cptr = fmt_findcomp("to");
            if (cptr)
        }
        if (to) {
            cptr = fmt_findcomp("to");
            if (cptr)
-               cptr->c_text = to;
+               cptr->c_text = to;
        }
        if (cc) {
            cptr = fmt_findcomp("cc");
            if (cptr)
        }
        if (cc) {
            cptr = fmt_findcomp("cc");
            if (cptr)
-               cptr->c_text = cc;
+               cptr->c_text = cc;
        }
        if (fcc) {
            cptr = fmt_findcomp("fcc");
            if (cptr)
        }
        if (fcc) {
            cptr = fmt_findcomp("fcc");
            if (cptr)
-               cptr->c_text = fcc;
+               cptr->c_text = fcc;
        }
        if (subject) {
            cptr = fmt_findcomp("subject");
            if (cptr)
        }
        if (subject) {
            cptr = fmt_findcomp("subject");
            if (cptr)
-               cptr->c_text = subject;
+               cptr->c_text = subject;
        }
     }
 
 try_it_again:
     strncpy (drft, build ? m_maildir ("draft")
        }
     }
 
 try_it_again:
     strncpy (drft, build ? m_maildir ("draft")
-                       : m_draft (dfolder, file, use, &isdf), sizeof(drft));
+                       : m_draft (dfolder, file, use, &isdf), sizeof(drft));
 
     /*
      * Check if we have an existing draft
 
     /*
      * Check if we have an existing draft