if (!Context->mailbox->quiet)
{
- char msgbuf[256];
- snprintf(msgbuf, sizeof(msgbuf), _("Update tags..."));
- mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, 1,
- Context->mailbox->msg_tagged);
+ mutt_progress_init(&progress, _("Update tags..."), MUTT_PROGRESS_MSG,
+ 1, Context->mailbox->msg_tagged);
}
#ifdef USE_NOTMUCH
struct Maildir *md = NULL;
struct MhSequences mhs = { 0 };
struct Maildir **last = NULL;
- char msgbuf[256];
struct Progress progress;
if (!m->quiet)
{
- snprintf(msgbuf, sizeof(msgbuf), _("Scanning %s..."), mailbox_path(m));
- mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, C_ReadInc, 0);
+ char msg[PATH_MAX];
+ snprintf(msg, sizeof(msg), _("Scanning %s..."), mailbox_path(m));
+ mutt_progress_init(&progress, msg, MUTT_PROGRESS_MSG, C_ReadInc, 0);
}
struct MaildirMboxData *mdata = maildir_mdata_get(m);
if (!m->quiet)
{
- snprintf(msgbuf, sizeof(msgbuf), _("Reading %s..."), mailbox_path(m));
- mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, C_ReadInc, count);
+ char msg[PATH_MAX];
+ snprintf(msg, sizeof(msg), _("Reading %s..."), mailbox_path(m));
+ mutt_progress_init(&progress, msg, MUTT_PROGRESS_MSG, C_ReadInc, count);
}
maildir_delayed_parsing(m, &md, &progress);
int i, j;
header_cache_t *hc = NULL;
- char msgbuf[PATH_MAX + 64];
struct Progress progress;
if (m->magic == MUTT_MH)
if (!m->quiet)
{
- snprintf(msgbuf, sizeof(msgbuf), _("Writing %s..."), mailbox_path(m));
- mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, C_WriteInc, m->msg_count);
+ char msg[PATH_MAX];
+ snprintf(msg, sizeof(msg), _("Writing %s..."), mailbox_path(m));
+ mutt_progress_init(&progress, msg, MUTT_PROGRESS_MSG, C_WriteInc, m->msg_count);
}
for (i = 0; i < m->msg_count; i++)
if (!m->quiet)
{
- char msgbuf[256];
- snprintf(msgbuf, sizeof(msgbuf), _("Reading %s..."), mailbox_path(m));
- mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, C_ReadInc, 0);
+ char msg[PATH_MAX];
+ snprintf(msg, sizeof(msg), _("Reading %s..."), mailbox_path(m));
+ mutt_progress_init(&progress, msg, MUTT_PROGRESS_MSG, C_ReadInc, 0);
}
while (true)
if (!m->quiet)
{
- char msgbuf[256];
- snprintf(msgbuf, sizeof(msgbuf), _("Reading %s..."), mailbox_path(m));
- mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, C_ReadInc, 0);
+ char msg[PATH_MAX];
+ snprintf(msg, sizeof(msg), _("Reading %s..."), mailbox_path(m));
+ mutt_progress_init(&progress, msg, MUTT_PROGRESS_MSG, C_ReadInc, 0);
}
if (!m->emails)
struct MUpdate *old_offset = NULL;
FILE *fp = NULL;
struct Progress progress;
- char msgbuf[PATH_MAX + 64];
/* sort message by their position in the mailbox on disk */
if (C_Sort != SORT_ORDER)
if (!m->quiet)
{
- snprintf(msgbuf, sizeof(msgbuf), _("Writing %s..."), mailbox_path(m));
- mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, C_WriteInc, m->msg_count);
+ char msg[PATH_MAX];
+ snprintf(msg, sizeof(msg), _("Writing %s..."), mailbox_path(m));
+ mutt_progress_init(&progress, msg, MUTT_PROGRESS_MSG, C_WriteInc, m->msg_count);
}
for (i = first, j = 0; i < m->msg_count; i++)
if (!mdata->progress_ready && q)
{
- static char msg[256];
- snprintf(msg, sizeof(msg), _("Reading messages..."));
-
// The total mail count is in oldmsgcount, so use that instead of recounting.
- mutt_progress_init(&mdata->progress, msg, MUTT_PROGRESS_MSG, C_ReadInc,
- mdata->oldmsgcount);
+ mutt_progress_init(&mdata->progress, _("Reading messages..."),
+ MUTT_PROGRESS_MSG, C_ReadInc, mdata->oldmsgcount);
mdata->progress_ready = true;
}
if (!m->quiet)
{
- char msgbuf[PATH_MAX + 64];
/* all is in this function so we don't use data->progress here */
- snprintf(msgbuf, sizeof(msgbuf), _("Writing %s..."), mailbox_path(m));
- mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, C_WriteInc, m->msg_count);
+ char msg[PATH_MAX];
+ snprintf(msg, sizeof(msg), _("Writing %s..."), mailbox_path(m));
+ mutt_progress_init(&progress, msg, MUTT_PROGRESS_MSG, C_WriteInc, m->msg_count);
}
header_cache_t *h = nm_hcache_open(m);
/**
* mutt_progress_init - Set up a progress bar
* @param progress Progress bar
- * @param msg Message to display
+ * @param msg Message to display; this is copied into the Progress object
* @param flags Flags, e.g. #MUTT_PROGRESS_SIZE
* @param inc Increments to display (0 disables updates)
* @param size Total size of expected file / traffic
memset(progress, 0, sizeof(struct Progress));
progress->inc = inc;
progress->flags = flags;
- progress->msg = msg;
+ mutt_str_strfcpy(progress->msg, msg, sizeof(progress->msg));
progress->size = size;
if (progress->size != 0)
{
{
unsigned short inc;
unsigned short flags;
- const char *msg;
+ char msg[1024];
long pos;
size_t size;
unsigned int timestamp;