commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-2.2-368-g79cbad0


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-368-g79cbad0
Date: Wed, 08 Jun 2011 06:22:33 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=79cbad0dff9d90f4b79fc09f2c5793ed28531608

The branch, master has been updated
       via  79cbad0dff9d90f4b79fc09f2c5793ed28531608 (commit)
      from  73be707da183c2ed8d59e7da781790c8ee759d1d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 79cbad0dff9d90f4b79fc09f2c5793ed28531608
Author: Sergey Poznyakoff <address@hidden>
Date:   Wed Jun 8 09:19:15 2011 +0300

    Various minor fixes.
    
    * include/mailutils/diag.h (mu_full_program_name): New extern.
    * libmailutils/diag/diag.c (mu_full_program_name): New global.
    (mu_set_program_name): Set mu_full_program_name.
    (mu_diag_at_locus): Fix format specifier.
    * libmailutils/diag/bt.c: Use mu_full_program_name instead of
    program_invocation_name.
    * libmailutils/diag/wd.c (mu_wd): Likewise.
    
    * comsat/comsat.c: Fix format specifiers.
    * lib/mailcap.c: Likewise.
    * libmu_sieve/util.c: Cast formatted arguments to match format specs.
    * mh/mh_getopt.c: Likewise.
    
    * libmailutils/cidr/fromstr.c: Add missing includes.
    * libproto/mailer/smtp.c: Likewise.
    * libproto/pop/mbox.c: Likewise.
    * testsuite/smtpsend.c: Likewise.
    * mu/getarg.c: Likewise.
    * mu/imap.c: Likewise.
    * mu/pop.c (com_connect): Protect TLS code with #ifdef.
    * mu/Makefile.am (EXTRA_DIST): Add mu-setup.awk.
    
    * mail/summary.c (mail_summary): Fix data types of the counters.

-----------------------------------------------------------------------

Summary of changes:
 comsat/comsat.c             |    7 ++++---
 include/mailutils/diag.h    |    1 +
 lib/mailcap.c               |    2 +-
 libmailutils/cidr/fromstr.c |    6 +++++-
 libmailutils/diag/bt.c      |   16 +++++++---------
 libmailutils/diag/diag.c    |    5 ++++-
 libmailutils/diag/wd.c      |    3 +--
 libmu_sieve/util.c          |    9 ++++++---
 libproto/mailer/smtp.c      |    1 +
 libproto/pop/mbox.c         |    1 +
 mail/summary.c              |   18 ++++++++----------
 mh/mh_getopt.c              |    2 +-
 mu/Makefile.am              |    2 +-
 mu/getarg.c                 |    1 +
 mu/imap.c                   |    1 +
 mu/pop.c                    |   11 +++++------
 testsuite/smtpsend.c        |    1 +
 17 files changed, 49 insertions(+), 38 deletions(-)

diff --git a/comsat/comsat.c b/comsat/comsat.c
index 2d22414..9592e48 100644
--- a/comsat/comsat.c
+++ b/comsat/comsat.c
@@ -379,9 +379,10 @@ comsat_connection (int fd, struct sockaddr *sa, int salen,
     {
       char *p = mu_sockaddr_to_astr (sa, salen);
       mu_diag_output (MU_DIAG_INFO,
-                     ngettext ("received %d byte from %s",
-                               "received %d bytes from %s", rdlen),
-                     rdlen, p);
+                     ngettext ("received %lu byte from %s",
+                               "received %lu bytes from %s",
+                               (unsigned long) rdlen),
+                     (unsigned long) rdlen, p);
       mu_diag_output (MU_DIAG_INFO, "string: %s", buffer);
       free (p);
     }
diff --git a/include/mailutils/diag.h b/include/mailutils/diag.h
index 84e28a3..1983b13 100644
--- a/include/mailutils/diag.h
+++ b/include/mailutils/diag.h
@@ -30,6 +30,7 @@ extern "C" {
 #endif
 
 extern const char *mu_program_name;
+extern const char *mu_full_program_name;
 
 #define MU_DIAG_EMERG    MU_LOG_EMERG
 #define MU_DIAG_ALERT    MU_LOG_ALERT
diff --git a/lib/mailcap.c b/lib/mailcap.c
index be993f1..2ffa50d 100644
--- a/lib/mailcap.c
+++ b/lib/mailcap.c
@@ -387,7 +387,7 @@ dump_mailcap_entry (mu_mailcap_entry_t entry)
                    mu_strerror (status));
          break;
        }
-      printf ("fields[%d]: %s\n", i, buffer);
+      printf ("fields[%u]: %s\n", (unsigned) i, buffer);
     }
   printf ("\n");
 }
diff --git a/libmailutils/cidr/fromstr.c b/libmailutils/cidr/fromstr.c
index 4e7a56f..95ef47c 100644
--- a/libmailutils/cidr/fromstr.c
+++ b/libmailutils/cidr/fromstr.c
@@ -18,9 +18,13 @@
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
 #include <string.h>
 #include <stdlib.h>
-#include <arpa/inet.h>
 #include <mailutils/cidr.h>
 #include <mailutils/errno.h>
 #include <mailutils/sockaddr.h>
diff --git a/libmailutils/diag/bt.c b/libmailutils/diag/bt.c
index 6bdae8b..7f3f257 100644
--- a/libmailutils/diag/bt.c
+++ b/libmailutils/diag/bt.c
@@ -23,8 +23,9 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
-#include <argp.h>
+#include <mailutils/diag.h>
 #include <mailutils/util.h>
 
 /* Dump a stack trace and terminate current program.
@@ -40,16 +41,13 @@ mu_gdb_bt ()
   pid_t pid;
   static char buf[1024];
   static char fname[1024];
-  char *p;
   int fd;
   char *argv[8];
   
-  p = strrchr (program_invocation_name, '/');
-  if (p)
-    p++;
-  else
-    p = program_invocation_name;
-  sprintf (fname, "/tmp/mailutils.%s.%lu", p, (unsigned long) master_pid);
+  if (!mu_program_name)
+    abort ();
+  sprintf (fname, "/tmp/mailutils.%s.%lu",
+          mu_program_name, (unsigned long) master_pid);
   
   pid = fork ();
   if (pid == (pid_t)-1)
@@ -72,7 +70,7 @@ mu_gdb_bt ()
   close (fd);
   
   argv[0] = "/usr/bin/gdb";
-  argv[1] = program_invocation_name;
+  argv[1] = (char*) mu_full_program_name;
   sprintf (buf, "%lu", (unsigned long) master_pid);
   argv[2] = buf;
   argv[3] = "-ex";
diff --git a/libmailutils/diag/diag.c b/libmailutils/diag/diag.c
index 06f3a97..f8cd53f 100644
--- a/libmailutils/diag/diag.c
+++ b/libmailutils/diag/diag.c
@@ -31,12 +31,14 @@
 #include <mailutils/stream.h>
 
 const char *mu_program_name;
+const char *mu_full_program_name;
 
 void
 mu_set_program_name (const char *name)
 {
   const char *progname;
 
+  mu_full_program_name = name;
   if (!name)
     progname = name;
   else
@@ -86,7 +88,8 @@ mu_diag_at_locus (int level, struct mu_locus const *loc, 
const char *fmt, ...)
 
   va_start (ap, fmt);
   mu_stream_printf (mu_strerr, "\033f<%d>%s\033l<%u>\033c<%u>",
-                   strlen (loc->mu_file), loc->mu_file, loc->mu_line,
+                   (unsigned) strlen (loc->mu_file), loc->mu_file,
+                   loc->mu_line,
                    loc->mu_col);
   mu_diag_voutput (level, fmt, ap);
   va_end (ap);
diff --git a/libmailutils/diag/wd.c b/libmailutils/diag/wd.c
index 9b78c12..0ccfd06 100644
--- a/libmailutils/diag/wd.c
+++ b/libmailutils/diag/wd.c
@@ -20,7 +20,6 @@
 #endif
 
 #include <unistd.h>
-#include <argp.h>
 #include <mailutils/diag.h>
 
 /* A debugging hook.
@@ -46,7 +45,7 @@ mu_wd (unsigned to)
                    (unsigned long) pid);
   mu_diag_output (MU_DIAG_CRIT,
                  "to attach: gdb -ex 'set variable mu_wd::_count_down=0' %s 
%lu",
-                 program_invocation_name, (unsigned long) pid);
+                 mu_full_program_name, (unsigned long) pid);
   if (to)
     {
       _count_down = to;
diff --git a/libmu_sieve/util.c b/libmu_sieve/util.c
index 154c2c3..1fa7378 100644
--- a/libmu_sieve/util.c
+++ b/libmu_sieve/util.c
@@ -213,7 +213,8 @@ mu_sieve_error (mu_sieve_machine_t mach, const char *fmt, 
...)
   if (mach->locus.mu_file)
     mu_stream_printf (mach->errstream, "\033O<%d>\033f<%u>%s\033l<%u>",
                      MU_LOGMODE_LOCUS,
-                     strlen (mach->locus.mu_file), mach->locus.mu_file,
+                     (unsigned) strlen (mach->locus.mu_file),
+                     mach->locus.mu_file,
                      mach->locus.mu_line);
   if (mach->identifier)
     mu_stream_printf (mach->errstream, "%s: ", mach->identifier);
@@ -238,7 +239,8 @@ mu_sieve_debug (mu_sieve_machine_t mach, const char *fmt, 
...)
   if (mach->locus.mu_file)
     mu_stream_printf (mach->errstream, "\033O<%d>\033f<%u>%s\033l<%u>",
                      MU_LOGMODE_LOCUS,
-                     strlen (mach->locus.mu_file), mach->locus.mu_file,
+                     (unsigned) strlen (mach->locus.mu_file),
+                     mach->locus.mu_file,
                      mach->locus.mu_line);
   mu_stream_vprintf (mach->errstream, fmt, ap);
   mu_stream_write (mach->errstream, "\n", 1, NULL);
@@ -258,7 +260,8 @@ mu_sieve_log_action (mu_sieve_machine_t mach, const char 
*action,
   if (mach->locus.mu_file)
     mu_stream_printf (mach->errstream, "\033O<%d>\033f<%u>%s\033l<%u>",
                      MU_LOGMODE_LOCUS,
-                     strlen (mach->locus.mu_file), mach->locus.mu_file,
+                     (unsigned) strlen (mach->locus.mu_file),
+                     mach->locus.mu_file,
                      mach->locus.mu_line);
   mach->logger (mach->data, mach->errstream, mach->msgno, mach->msg,
                action, fmt, ap);
diff --git a/libproto/mailer/smtp.c b/libproto/mailer/smtp.c
index 6487b67..7177f3b 100644
--- a/libproto/mailer/smtp.c
+++ b/libproto/mailer/smtp.c
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <netinet/in.h>
 
 #include <mailutils/nls.h>
 #include <mailutils/address.h>
diff --git a/libproto/pop/mbox.c b/libproto/pop/mbox.c
index b3a0203..067d244 100644
--- a/libproto/pop/mbox.c
+++ b/libproto/pop/mbox.c
@@ -28,6 +28,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <netdb.h>
+#include <netinet/in.h>
 
 #include <mailutils/pop3.h>
 #include <mailutils/attribute.h>
diff --git a/mail/summary.c b/mail/summary.c
index 2339636..072a25f 100644
--- a/mail/summary.c
+++ b/mail/summary.c
@@ -28,8 +28,8 @@ mail_summary (int argc MU_ARG_UNUSED, char **argv 
MU_ARG_UNUSED)
   mu_attribute_t attr;
   size_t msgno;
   size_t count = 0;
-  int mseen = 0, mnew = 0, mdelete = 0;
-  int first_new = 0, first_unread = 0;
+  unsigned long mseen = 0, mnew = 0, mdelete = 0;
+  size_t first_new = 0, first_unread = 0;
 
   mu_mailbox_messages_count (mbox, &count);
   for (msgno = 1; msgno <= count; msgno++)
@@ -62,17 +62,15 @@ mail_summary (int argc MU_ARG_UNUSED, char **argv 
MU_ARG_UNUSED)
     mu_mailbox_get_url (mbox, &url);
     mu_printf ("\"%s\": ", util_url_to_string (url));
   }
-  mu_printf (
-                   ngettext ("%d message", "%d messages", count), count);
+  mu_printf (ngettext ("%lu message", "%lu messages",
+                      (unsigned long) count), (unsigned long) count);
   if (mnew > 0)
-    mu_printf (ngettext (" %d new", " %d new", mnew), mnew);
+    mu_printf (ngettext (" %lu new", " %lu new", mnew), mnew);
   if (mseen > 0)
-    mu_printf (ngettext (" %d unread", " %d unread", mseen),
-                     mseen);
+    mu_printf (ngettext (" %lu unread", " %lu unread", mseen), mseen);
   if (mdelete > 0)
-    mu_printf (
-                     ngettext (" %d deleted", " %d deleted", mdelete),
-                     mdelete);
+    mu_printf (ngettext (" %lu deleted", " %lu deleted", mdelete),
+              mdelete);
   mu_printf ("\n");
 
   /* Set the cursor.  */
diff --git a/mh/mh_getopt.c b/mh/mh_getopt.c
index 3399fb4..7f911a3 100644
--- a/mh/mh_getopt.c
+++ b/mh/mh_getopt.c
@@ -135,7 +135,7 @@ mh_help (struct mh_option *mh_opt, const char *doc)
        printf ("[no]");
       if (len > p->match_len)
        printf ("(%*.*s)%s",
-               p->match_len, p->match_len, p->opt,
+               (int) p->match_len, (int) p->match_len, p->opt,
                p->opt + p->match_len);
       else
        printf ("%s", p->opt);
diff --git a/mu/Makefile.am b/mu/Makefile.am
index f7fdfa4..5534d03 100644
--- a/mu/Makefile.am
+++ b/mu/Makefile.am
@@ -80,7 +80,7 @@ AM_CPPFLAGS = \
   -DI18NLIBS="\"$(LIBINTL)\""
 
 BUILT_SOURCES=mu-setup.c mu-setup.h
-EXTRA_DIST=mu-setup.c mu-setup.h template.c
+EXTRA_DIST=mu-setup.awk mu-setup.c mu-setup.h template.c
 
 mu-setup.h: Makefile.am $(MODULES) $(IDLE_MODULES) 
        $(AM_V_GEN)$(AWK) -f $(top_srcdir)/mu/mu-setup.awk -v mode=h \
diff --git a/mu/getarg.c b/mu/getarg.c
index 6e6267c..b148b9c 100644
--- a/mu/getarg.c
+++ b/mu/getarg.c
@@ -21,6 +21,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <netdb.h>
+#include <netinet/in.h>
 #include <mailutils/mailutils.h>
 #include "mu.h"
 
diff --git a/mu/imap.c b/mu/imap.c
index 4fccd4d..c531d9b 100644
--- a/mu/imap.c
+++ b/mu/imap.c
@@ -22,6 +22,7 @@
 #include <termios.h>
 #include <unistd.h>
 #include <netdb.h>
+#include <netinet/in.h>
 #include <mailutils/mailutils.h>
 #include <mailutils/imap.h>
 #include "mu.h"
diff --git a/mu/pop.c b/mu/pop.c
index c76f009..b0d7128 100644
--- a/mu/pop.c
+++ b/mu/pop.c
@@ -501,13 +501,12 @@ com_connect (int argc, char **argv)
     {
       if (strcmp (argv[i], "-tls") == 0)
        {
-         if (WITH_TLS)
+#ifdef WITH_TLS
            tls = 1;
-         else
-           {
-             mu_error ("TLS not supported");
-             return 0;
-           }
+#else
+           mu_error ("TLS not supported");
+           return 0;
+#endif
        }
       else
        break;
diff --git a/testsuite/smtpsend.c b/testsuite/smtpsend.c
index 2fe2d9f..b4f3754 100644
--- a/testsuite/smtpsend.c
+++ b/testsuite/smtpsend.c
@@ -21,6 +21,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <netdb.h>
+#include <netinet/in.h>
 #include <mailutils/cctype.h>
 #include <mailutils/mailutils.h>
 #include <mailutils/smtp.h>


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]