summaryrefslogtreecommitdiffstats
path: root/buffy.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2019-04-07 16:02:02 -0700
committerKevin McCarthy <kevin@8t8.us>2019-04-07 16:02:02 -0700
commitbcda4240165ff4e3b3f7da5677a3e0ddd00aa8b6 (patch)
treeea41383488df5ea18ab7d70db829803d09953912 /buffy.c
parenta69a853fdf1407b8e0c53f1fb63f2f0e1a71a9b2 (diff)
Create mutt_buffer_buffy() buffer function.
Relocate some of the buffy function declarations to buffy.h while adding the new declaration.
Diffstat (limited to 'buffy.c')
-rw-r--r--buffy.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/buffy.c b/buffy.c
index 849d25ee..d413abf5 100644
--- a/buffy.c
+++ b/buffy.c
@@ -726,18 +726,31 @@ int mutt_buffy_notify (void)
return (0);
}
+void mutt_buffy (char *s, size_t slen)
+{
+ BUFFER *s_buf;
+
+ s_buf = mutt_buffer_pool_get ();
+
+ mutt_buffer_addstr (s_buf, NONULL (s));
+ mutt_buffer_buffy (s_buf);
+ strfcpy (s, mutt_b2s (s_buf), slen);
+
+ mutt_buffer_pool_release (&s_buf);
+}
+
/*
* mutt_buffy() -- incoming folders completion routine
*
* given a folder name, this routine gives the next incoming folder with new
* mail.
*/
-void mutt_buffy (char *s, size_t slen)
+void mutt_buffer_buffy (BUFFER *s)
{
BUFFY *tmp = Incoming;
int pass, found = 0;
- mutt_expand_path (s, slen);
+ mutt_buffer_expand_path (s);
if (mutt_buffy_check (0))
{
@@ -747,11 +760,11 @@ void mutt_buffy (char *s, size_t slen)
mutt_expand_path (tmp->path, sizeof (tmp->path));
if ((found || pass) && tmp->new)
{
- strfcpy (s, tmp->path, slen);
- mutt_pretty_mailbox (s, slen);
+ mutt_buffer_strcpy (s, tmp->path);
+ mutt_buffer_pretty_mailbox (s);
return;
}
- if (mutt_strcmp (s, tmp->path) == 0)
+ if (mutt_strcmp (mutt_b2s (s), tmp->path) == 0)
found = 1;
}
@@ -760,7 +773,7 @@ void mutt_buffy (char *s, size_t slen)
}
/* no folders with new mail */
- *s = '\0';
+ mutt_buffer_clear (s);
}
/* fetch buffy object for given path, if present */