]> diplodocus.org Git - nmh/blobdiff - uip/scansbr.c
Print port number in the connection error message
[nmh] / uip / scansbr.c
index 81abc7d4d4549960958af1dfe1b4ada7da136f82..b6df683071adbd77cb049fe84dac45d71aef9d70 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
  */
 
 #include "h/mh.h"
+#include "sbr/dtime.h"
 #include "scansbr.h"
 #include "sbr/m_name.h"
 #include "sbr/m_gmprot.h"
 #include "scansbr.h"
 #include "sbr/m_name.h"
 #include "sbr/m_gmprot.h"
@@ -23,7 +24,7 @@ static struct comp *datecomp;         /* pntr to "date" comp             */
 static struct comp *bodycomp;          /* pntr to "body" pseudo-comp      *
                                         * (if referenced)                 */
 static int ncomps = 0;                 /* # of interesting components     */
 static struct comp *bodycomp;          /* pntr to "body" pseudo-comp      *
                                         * (if referenced)                 */
 static int ncomps = 0;                 /* # of interesting components     */
-static char **compbuffers = 0;                 /* buffers for component text      */
+static char **compbuffers = 0;         /* buffers for component text      */
 static struct comp **used_buf = 0;     /* stack for comp that use buffers */
 
 static int dat[5];                     /* aux. data for format routine    */
 static struct comp **used_buf = 0;     /* stack for comp that use buffers */
 
 static int dat[5];                     /* aux. data for format routine    */
@@ -56,7 +57,7 @@ scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg,
 {
     static bool deja_vu;
     static int tty_width;
 {
     static bool deja_vu;
     static int tty_width;
-    int i, compnum, encrypted, state;
+    int i, compnum, state;
     char *cp, *tmpbuf, *startbody, **nxtbuf;
     char *saved_c_text = NULL;
     struct comp *cptr;
     char *cp, *tmpbuf, *startbody, **nxtbuf;
     char *saved_c_text = NULL;
     struct comp *cptr;
@@ -95,9 +96,6 @@ scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg,
        cptr = fmt_findcomp("folder");
        if (cptr && folder)
            cptr->c_text = mh_xstrdup(folder);
        cptr = fmt_findcomp("folder");
        if (cptr && folder)
            cptr->c_text = mh_xstrdup(folder);
-       if (fmt_addcompentry("encrypted")) {
-               ncomps++;
-       }
        cptr =  fmt_findcomp("dtimenow");
        if (cptr)
            cptr->c_text = getcpy(dtimenow (0));
        cptr =  fmt_findcomp("dtimenow");
        if (cptr)
            cptr->c_text = getcpy(dtimenow (0));
@@ -229,7 +227,7 @@ scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg,
                if (outnum == 0) {
                    state = FILEEOF; /* stop now if scan cmd */
                    if (bodycomp && startbody == NULL)
                if (outnum == 0) {
                    state = FILEEOF; /* stop now if scan cmd */
                    if (bodycomp && startbody == NULL)
-                       startbody = tmpbuf;
+                       startbody = tmpbuf;
                    goto finished;
                }
                 if (scnout) {
                    goto finished;
                }
                 if (scnout) {
@@ -268,7 +266,7 @@ body:;
 
            case LENERR: 
            case FMTERR: 
 
            case LENERR: 
            case FMTERR: 
-               if (innum)
+               if (innum)
                    fprintf (stderr, "??Format error (message %d) in ",
                             outnum ? outnum : innum);
                else
                    fprintf (stderr, "??Format error (message %d) in ",
                             outnum ? outnum : innum);
                else
@@ -342,9 +340,6 @@ finished:
     if (noisy)
        fputs (charstring_buffer (*scanl), stdout);
 
     if (noisy)
        fputs (charstring_buffer (*scanl), stdout);
 
-    cptr = fmt_findcomp ("encrypted");
-    encrypted = cptr && cptr->c_text;
-
     /* return dynamically allocated buffers to pool */
     while ((cptr = *savecomp++)) {
        cptr->c_text = NULL;
     /* return dynamically allocated buffers to pool */
     while ((cptr = *savecomp++)) {
        cptr->c_text = NULL;
@@ -353,7 +348,7 @@ finished:
     if (scnout && (ferror(scnout) || fclose (scnout) == EOF))
        DIEWRERR();
 
     if (scnout && (ferror(scnout) || fclose (scnout) == EOF))
        DIEWRERR();
 
-    return state != FILEEOF ? SCNERR : encrypted ? SCNENC : SCNMSG;
+    return state != FILEEOF ? SCNERR : SCNMSG;
 }
 
 
 }