]> diplodocus.org Git - nmh/blobdiff - uip/comp.c
lock_file.c: close(2) file descriptor on failure, avoiding leak.
[nmh] / uip / comp.c
index 8129bb4c6646e15709e86c4b3d1df77f614de34a..744ea19beb7c05c711cd719f640cad82a19da840 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * comp.c -- compose a message
+/* comp.c -- compose a message
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -10,6 +8,7 @@
 #include <h/mh.h>
 #include <h/utils.h>
 #include <h/fmt_scan.h>
 #include <h/mh.h>
 #include <h/utils.h>
 #include <h/fmt_scan.h>
+#include "sbr/m_maildir.h"
 #include <fcntl.h>
 
 #define COMP_SWITCHES \
 #include <fcntl.h>
 
 #define COMP_SWITCHES \
@@ -31,7 +30,7 @@
     X("cc address", 0, CCSW) \
     X("from address", 0, FROMSW) \
     X("fcc mailbox", 0, FCCSW) \
     X("cc address", 0, CCSW) \
     X("from address", 0, FROMSW) \
     X("fcc mailbox", 0, FCCSW) \
-    X("width colums", 0, WIDTHSW) \
+    X("width columns", 0, WIDTHSW) \
     X("subject text", 0, SUBJECTSW) \
 
 #define X(sw, minchars, id) id,
     X("subject text", 0, SUBJECTSW) \
 
 #define X(sw, minchars, id) id,
@@ -123,7 +122,7 @@ main (int argc, char **argv)
 
                case BILDSW:
                    build++;
 
                case BILDSW:
                    build++;
-                   /* fall through */
+                   /* FALLTHRU */
                case NWHATSW: 
                    nwhat++;
                    continue;
                case NWHATSW: 
                    nwhat++;
                    continue;
@@ -192,7 +191,7 @@ main (int argc, char **argv)
                    if (*cp == '@')
                        cp = dp = path(cp + 1, TSUBCWF);
                    fcc = addlist(fcc, cp);
                    if (*cp == '@')
                        cp = dp = path(cp + 1, TSUBCWF);
                    fcc = addlist(fcc, cp);
-                    mh_xfree(dp);
+                    free(dp);
                    continue;
 
                case WIDTHSW:
                    continue;
 
                case WIDTHSW:
@@ -212,13 +211,11 @@ main (int argc, char **argv)
        if (*cp == '+' || *cp == '@') {
            if (folder)
                adios (NULL, "only one folder at a time!");
        if (*cp == '+' || *cp == '@') {
            if (folder)
                adios (NULL, "only one folder at a time!");
-           else
-               folder = pluspath (cp);
+            folder = pluspath (cp);
        } else {
            if (msg)
                adios (NULL, "only one message at a time!");
        } else {
            if (msg)
                adios (NULL, "only one message at a time!");
-           else
-               msg = cp;
+            msg = cp;
        }
     }
 
        }
     }
 
@@ -359,7 +356,7 @@ try_it_again:
                        i = YESW;
                    break;
                default: 
                        i = YESW;
                    break;
                default: 
-                   advise (NULL, "say what?");
+                   inform("say what?");
                    break;
            }
        }
                    break;
            }
        }
@@ -397,7 +394,7 @@ edit_it:
 
     if (nwhat)
        done (0);
 
     if (nwhat)
        done (0);
-    what_now (ed, nedit, use, drft, NULL, 0, NULLMP, NULL, 0, cwd, 0);
+    what_now (ed, nedit, use, drft, NULL, 0, NULL, NULL, 0, cwd, 0);
     done (1);
     return 1;
 }
     done (1);
     return 1;
 }