]> diplodocus.org Git - nmh/blobdiff - uip/post.c
Remove ./configure's --enable-debug support; it did nothing.
[nmh] / uip / post.c
index d1e58ebf8e6037053d5e743d0ea0eceeb66a347f..13dbb58ae4d996e08d60c0fcb0fc09acd89c2aa8 100644 (file)
@@ -305,7 +305,6 @@ static void fcc (char *, char *);
 static void die (char *, char *, ...);
 static void post (char *, int, int, int, char *, int, char *);
 static void do_text (char *file, int fd);
-static int scan_input (int, int *);
 static void do_an_address (struct mailname *, int);
 static void do_addresses (int, int);
 static int find_prefix (void);
@@ -805,8 +804,7 @@ putfmt (char *name, char *str, int *eai, FILE *out)
               should never have reached this point.  Warn about any
               that are non-empty. */
            if (strcmp (str, "\n")) {
-               char *newline = strchr (str, '\n');
-               if (newline) *newline = '\0';
+                TrimSuffixC(str, '\n');
                if (! whomsw) {
                    advise (NULL, "ignoring header line -- %s: %s", name, str);
                }
@@ -828,7 +826,7 @@ putfmt (char *name, char *str, int *eai, FILE *out)
     msgflags |= (hdr->set & ~(MVIS | MINV));
 
     if (hdr->flags & HSUB)
-       subject = subject ? add (str, add ("\t", subject)) : getcpy (str);
+       subject = subject ? add (str, add ("\t", subject)) : mh_xstrdup(str);
     if (hdr->flags & HFCC) {
        if ((cp = strrchr(str, '\n')))
            *cp = 0;
@@ -1219,7 +1217,7 @@ putadr (char *name, char *aka, struct mailname *mp, FILE *out, unsigned int flag
     }
 
     if (*aka && mp->m_type != UUCPHOST && !mp->m_pers)
-       mp->m_pers = getcpy (aka);
+       mp->m_pers = mh_xstrdup(aka);
     if (format) {
        if (mp->m_gname) {
            snprintf (buffer, sizeof(buffer), "%s;", mp->m_gname);
@@ -1391,7 +1389,7 @@ insert_fcc (struct headers *hdr, char *pp)
 
     if (fccind >= FCCS)
        adios (NULL, "too many %ss", hdr->value);
-    fccfold[fccind++] = getcpy (cp);
+    fccfold[fccind++] = mh_xstrdup(cp);
 }
 
 /*
@@ -1855,27 +1853,6 @@ do_text (char *file, int fd)
 }
 
 
-/*
- * See if input has any 8-bit bytes.
- */
-static int
-scan_input (int fd, int *eightbit) {
-    int state;
-    char buf[BUFSIZ];
-
-    lseek (fd, (off_t) 0, SEEK_SET);
-
-    while ((state = read (fd, buf, sizeof buf)) > 0) {
-        if (contains8bit (buf, buf + state)) {
-            *eightbit = 1;
-            return OK;
-        }
-    }
-
-    return state == NOTOK  ?  NOTOK  :  OK;
-}
-
-
 /*
  * SIGNAL HANDLING
  */