summaryrefslogtreecommitdiffstats
path: root/browser.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2019-04-16 18:11:35 -0700
committerKevin McCarthy <kevin@8t8.us>2019-04-16 18:11:35 -0700
commit940bdaa1455829a1a5b0c6db05010c4dfc7d3dfe (patch)
treef4687039c2f23bd3ed056a45fb05c17e52693da1 /browser.c
parent797d16a316b2ea9b0d52ec3e04c8d0cce821a048 (diff)
Convert other users of BUFFY->pathbuf to use BUFFERS.
A few functions in browser.c, buffy.c, and monitor.c were using BUFFY->pathbuf but were potentially truncating via fixed size buffers. Convert those to use BUFFERS too. buffy_get() was creating epath and expanding it, apparently to match against expanded BUFFY list entries, was wasn't using the epath. I believe this is a bug, and have switched the comparison to epath.
Diffstat (limited to 'browser.c')
-rw-r--r--browser.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/browser.c b/browser.c
index cc976307..973e17ae 100644
--- a/browser.c
+++ b/browser.c
@@ -526,14 +526,15 @@ static int examine_directory (MUTTMENU *menu, struct browser_state *state,
static int examine_mailboxes (MUTTMENU *menu, struct browser_state *state)
{
struct stat s;
- char buffer[LONG_STRING];
BUFFY *tmp = Incoming;
+ BUFFER *mailbox = NULL;
BUFFER *md = NULL;
if (!Incoming)
return (-1);
mutt_buffy_check (0);
+ mailbox = mutt_buffer_pool_get ();
md = mutt_buffer_pool_get ();
init_state (state, menu);
@@ -546,21 +547,21 @@ static int examine_mailboxes (MUTTMENU *menu, struct browser_state *state)
tmp->msg_unread = Context->unread;
}
- strfcpy (buffer, mutt_b2s (tmp->pathbuf), sizeof (buffer));
+ mutt_buffer_strcpy (mailbox, mutt_b2s (tmp->pathbuf));
if (option (OPTBROWSERABBRMAILBOXES))
- mutt_pretty_mailbox (buffer, sizeof (buffer));
+ mutt_buffer_pretty_mailbox (mailbox);
#ifdef USE_IMAP
if (mx_is_imap (mutt_b2s (tmp->pathbuf)))
{
- add_folder (menu, state, buffer, NULL, tmp);
+ add_folder (menu, state, mutt_b2s (mailbox), NULL, tmp);
continue;
}
#endif
#ifdef USE_POP
if (mx_is_pop (mutt_b2s (tmp->pathbuf)))
{
- add_folder (menu, state, buffer, NULL, tmp);
+ add_folder (menu, state, mutt_b2s (mailbox), NULL, tmp);
continue;
}
#endif
@@ -585,11 +586,12 @@ static int examine_mailboxes (MUTTMENU *menu, struct browser_state *state)
s.st_mtime = st2.st_mtime;
}
- add_folder (menu, state, buffer, &s, tmp);
+ add_folder (menu, state, mutt_b2s (mailbox), &s, tmp);
}
while ((tmp = tmp->next));
browser_sort (state);
+ mutt_buffer_pool_release (&mailbox);
mutt_buffer_pool_release (&md);
return 0;
}