From: N.J. Mann Date: Wed, 12 Mar 2008 00:20:48 +0000 (-0700) Subject: Respect ctx->quiet when initializing progress bar. X-Git-Tag: mutt-1-5-18-rel~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8dcd8fd10b6ccc88c601556068aa00ea626379d;p=mutt Respect ctx->quiet when initializing progress bar. --- diff --git a/ChangeLog b/ChangeLog index 0d077ca5..0877f1d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-09 14:01 -0700 Sébastien Hinderer (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ř (fdad7b9fa741) * po/cs.po: Updated Czech translation diff --git a/mbox.c b/mbox.c index 80843ea5..c4501722 100644 --- 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 38d954e0..e020d0b9 100644 --- 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 255369c2..badb8255 100644 --- 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) {