]> Pileus Git - ~andy/fetchmail/commitdiff
Better default for showdots.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 10 Oct 2003 13:29:25 +0000 (13:29 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 10 Oct 2003 13:29:25 +0000 (13:29 -0000)
svn path=/trunk/; revision=3842

fetchmail.c
fetchmail.h
rcfile_y.y
transact.c

index e4a8cb721bb5af6ecc4446922f786a24dd49c431..6b26a6b28e3fced0e7d53c3729af5cf671d546de 100644 (file)
@@ -1106,6 +1106,8 @@ static int load_params(int argc, char **argv, int optind)
                exit(PS_SYNTAX);
            }
 #endif /* SSL_ENABLE */
+           /* one global gets treated specially */
+           DEFAULT(run.showdots, run.poll_interval==0 || nodetach);
 #undef DEFAULT
 
            /*
index edcb57c8c6c93800900e2dc8cfb72e39a9014e65..f13b1205cb2dd054edc90822ca744dee081a9a64 100644 (file)
@@ -508,7 +508,7 @@ void stuff_warning();
 void close_warning_by_mail(struct query *, struct msgblk *);
 
 /* rfc822.c: RFC822 header parsing */
-unsigned char *reply_hack(unsigned char *, const unsigned char *);
+unsigned char *reply_hack(unsigned char *, const unsigned char *, int *);
 unsigned char *nxtaddr(const unsigned char *);
 
 /* uid.c: UID support */
index bd5faa6dc117a585209e5c0b41c54c94972c3d9c..48f75ee44f0430027a9333467d280d8364e0f156 100644 (file)
@@ -106,8 +106,8 @@ statement   : SET LOGFILE optmap STRING     {run.logfile = prependdir ($4, rcfiledir);
                | SET NO SYSLOG                 {run.use_syslog = FALSE;}
                | SET INVISIBLE                 {run.invisible = TRUE;}
                | SET NO INVISIBLE              {run.invisible = FALSE;}
-               | SET SHOWDOTS                  {run.showdots = TRUE;}
-               | SET NO SHOWDOTS               {run.showdots = FALSE;}
+               | SET SHOWDOTS                  {run.showdots = FLAG_TRUE;}
+               | SET NO SHOWDOTS               {run.showdots = FLAG_FALSE;}
 
 /* 
  * The way the next two productions are written depends on the fact that
index 69053b566d0d9a566d2ef4fa2960893b5c9d5b52..49cffc08e1933f6fa5696d6ff13b1286896fc9a5 100644 (file)
@@ -448,7 +448,7 @@ int readheaders(int sock,
                 */
                if ( n && buf[n-1] != '\n' ) {
                        overlong = TRUE;
-                       rline = (char *) realloc(line, linelen);
+                       rline = (char *) realloc(line, linelen + 1);
                        if (rline == NULL)
                        {
                            free (line);
@@ -456,6 +456,7 @@ int readheaders(int sock,
                        }
                        line = rline;
                        memcpy(line + linelen - n, buf, n);
+                       line[linelen] = '\0';
                        ch = ' '; /* So the next iteration starts */
                        continue;
                }
@@ -551,7 +552,7 @@ int readheaders(int sock,
            sizeticker += linelen;
            while (sizeticker >= SIZETICKER)
            {
-               if ((!run.use_syslog && !isafile(1)) || run.showdots)
+               if (outlevel > O_SILENT && run.showdots)
                {
                    fputc('.', stdout);
                    fflush(stdout);
@@ -693,7 +694,7 @@ int readheaders(int sock,
        }
 
        if (ctl->rewrite)
-           line = reply_hack(line, ctl->server.truename);
+           line = reply_hack(line, ctl->server.truename, &linelen);
 
        /*
         * OK, this is messy.  If we're forwarding by SMTP, it's the
@@ -1337,7 +1338,7 @@ int readbody(int sock, struct query *ctl, flag forward, int len)
            sizeticker += linelen;
            while (sizeticker >= SIZETICKER)
            {
-               if (outlevel > O_SILENT && (((run.poll_interval == 0 || nodetach) && !isafile(1)) || run.showdots))
+               if (outlevel > O_SILENT && run.showdots)
                {
                    fputc('.', stdout);
                    fflush(stdout);