]> granicus.if.org Git - mutt/commitdiff
Respect ctx->quiet when initializing progress bar.
authorN.J. Mann <njm@njm.f2s.com>
Wed, 12 Mar 2008 00:20:48 +0000 (17:20 -0700)
committerN.J. Mann <njm@njm.f2s.com>
Wed, 12 Mar 2008 00:20:48 +0000 (17:20 -0700)
ChangeLog
mbox.c
mh.c
pop.c

index 0d077ca5df5405d7de292ea716ffb353310ded05..0877f1d3adf142a40f28d0ccbb1ecc0c9dff8ac3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-09 14:01 -0700  Sébastien Hinderer  <Sebastien.Hinderer@ens-lyon.org>  (c4212a17fad6)
+
+       * compose.c, mx.c: Remove pointless NULL checks against
+       arrays. This silences a warning on newer GCCs.
+
 2008-03-04 22:00 -0800  Petr Písař  <petr.pisar@atlas.cz>  (fdad7b9fa741)
 
        * po/cs.po: Updated Czech translation
diff --git a/mbox.c b/mbox.c
index 80843ea55d1f42bc18792b1485b97b85757a2a63..c4501722fa9c5268afe924d592aaf51b08f17a46 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -118,8 +118,11 @@ int mmdf_parse_mailbox (CONTEXT *ctx)
 
   buf[sizeof (buf) - 1] = 0;
 
-  snprintf (msgbuf, sizeof (msgbuf), _("Reading %s..."), ctx->path);
-  mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, ReadInc, 0);
+  if (!ctx->quiet)
+  {
+    snprintf (msgbuf, sizeof (msgbuf), _("Reading %s..."), ctx->path);
+    mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, ReadInc, 0);
+  }
 
   FOREVER
   {
@@ -269,8 +272,11 @@ int mbox_parse_mailbox (CONTEXT *ctx)
      date received */
   tz = mutt_local_tz (0);
 
-  snprintf (msgbuf, sizeof (msgbuf), _("Reading %s..."), ctx->path);
-  mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, ReadInc, 0);
+  if (!ctx->quiet)
+  {
+    snprintf (msgbuf, sizeof (msgbuf), _("Reading %s..."), ctx->path);
+    mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, ReadInc, 0);
+  }
 
   loc = ftello (ctx->fp);
   while (fgets (buf, sizeof (buf), ctx->fp) != NULL)
@@ -784,8 +790,11 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
   newOffset = safe_calloc (ctx->msgcount - first, sizeof (struct m_update_t));
   oldOffset = safe_calloc (ctx->msgcount - first, sizeof (struct m_update_t));
 
-  snprintf (msgbuf, sizeof (msgbuf), _("Writing %s..."), ctx->path);
-  mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, WriteInc, ctx->msgcount);
+  if (!ctx->quiet)
+  {
+    snprintf (msgbuf, sizeof (msgbuf), _("Writing %s..."), ctx->path);
+    mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, WriteInc, ctx->msgcount);
+  }
 
   for (i = first, j = 0; i < ctx->msgcount; i++)
   {
diff --git a/mh.c b/mh.c
index 38d954e034ebf5120ec42715aba1e23b6580305a..e020d0b9b7b0ca082c9afce4c70efc0ad673b6f3 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -1111,8 +1111,11 @@ int mh_read_dir (CONTEXT * ctx, const char *subdir)
   progress_t progress;
 
   memset (&mhs, 0, sizeof (mhs));
-  snprintf (msgbuf, sizeof (msgbuf), _("Scanning %s..."), ctx->path);
-  mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, ReadInc, 0);
+  if (!ctx->quiet)
+  {
+    snprintf (msgbuf, sizeof (msgbuf), _("Scanning %s..."), ctx->path);
+    mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, ReadInc, 0);
+  }
 
   if (!ctx->data)
   {
@@ -1129,8 +1132,11 @@ int mh_read_dir (CONTEXT * ctx, const char *subdir)
   if (maildir_parse_dir (ctx, &last, subdir, &count, &progress) == -1)
     return -1;
 
-  snprintf (msgbuf, sizeof (msgbuf), _("Reading %s..."), ctx->path);
-  mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, ReadInc, count);
+  if (!ctx->quiet)
+  {
+    snprintf (msgbuf, sizeof (msgbuf), _("Reading %s..."), ctx->path);
+    mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, ReadInc, count);
+  }
   maildir_delayed_parsing (ctx, &md, &progress);
 
   if (ctx->magic == M_MH)
@@ -1625,8 +1631,11 @@ int mh_sync_mailbox (CONTEXT * ctx, int *index_hint)
     hc = mutt_hcache_open(HeaderCache, ctx->path, NULL);
 #endif /* USE_HCACHE */
 
-  snprintf (msgbuf, sizeof (msgbuf), _("Writing %s..."), ctx->path);
-  mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, WriteInc, ctx->msgcount);
+  if (!ctx->quiet)
+  {
+    snprintf (msgbuf, sizeof (msgbuf), _("Writing %s..."), ctx->path);
+    mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, WriteInc, ctx->msgcount);
+  }
 
   for (i = 0; i < ctx->msgcount; i++)
   {
diff --git a/pop.c b/pop.c
index 255369c280cead714c5fe8aa84c906ab73ba2f24..badb8255baeecefa7fff21a3078c1fd37e560713 100644 (file)
--- a/pop.c
+++ b/pop.c
@@ -268,8 +268,9 @@ static int pop_fetch_headers (CONTEXT *ctx)
     }
   }
 
-  mutt_progress_init (&progress, _("Fetching message headers..."),
-                     M_PROGRESS_MSG, ReadInc, new_count - old_count);
+  if (!ctx->quiet)
+    mutt_progress_init (&progress, _("Fetching message headers..."),
+                        M_PROGRESS_MSG, ReadInc, new_count - old_count);
 
   if (ret == 0)
   {