[PATCH 2 of 3] Call mutt_expand_path() from mutt_buffy to fix imap separator
# HG changeset patch
# User Aron Griffis <agriffis@xxxxxxxxx>
# Date 1240340819 14400
# Branch HEAD
# Node ID ac4a424cf762c69b59e171c3b5ff333aad264436
# Parent 874143a8eefd52e9672a885f520ac795b102d869
Call mutt_expand_path() from mutt_buffy to fix imap separator.
Closes #3208 and #3218
Signed-off-by: Aron Griffis <agriffis@xxxxxxxxx>
diff --git a/buffy.c b/buffy.c
--- a/buffy.c
+++ b/buffy.c
@@ -206,7 +206,6 @@
{
for (tmp = &Incoming; *tmp;)
{
- FREE (&((*tmp)->path));
tmp1=(*tmp)->next;
FREE (tmp); /* __FREE_CHECKED__ */
*tmp=tmp1;
@@ -241,7 +240,7 @@
if (!*tmp)
{
*tmp = (BUFFY *) safe_calloc (1, sizeof (BUFFY));
- (*tmp)->path = safe_strdup (buf);
+ strfcpy ((*tmp)->path, buf, sizeof ((*tmp)->path));
(*tmp)->next = NULL;
/* it is tempting to set magic right here */
(*tmp)->magic = 0;
@@ -505,7 +504,7 @@
* mutt_buffy() -- incoming folders completion routine
*
* given a folder name, this routine gives the next incoming folder with new
- * new mail.
+ * mail.
*/
void mutt_buffy (char *s, size_t slen)
{
@@ -530,6 +529,7 @@
mutt_buffy_check (1); /* buffy was wrong - resync things */
break;
}
+ mutt_expand_path (tmp->path, sizeof (tmp->path));
strfcpy (s, tmp->path, slen);
mutt_pretty_mailbox (s, slen);
break;
@@ -539,6 +539,7 @@
count = 0;
while (count < 3)
{
+ mutt_expand_path (tmp->path, sizeof (tmp->path));
if (mutt_strcmp (s, tmp->path) == 0)
count++;
else if (count && tmp->new)
diff --git a/buffy.h b/buffy.h
--- a/buffy.h
+++ b/buffy.h
@@ -22,7 +22,7 @@
typedef struct buffy_t
{
- char *path;
+ char path[_POSIX_PATH_MAX];
off_t size;
struct buffy_t *next;
short new; /* mailbox has new mail */